Created
April 6, 2016 21:42
-
-
Save wende/44cdd9234c5486e34e67c01d49dd0a1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Queue do | |
@functions :queue.module_info(:exports) | |
Enum.map @functions, fn | |
{:module_info, _} -> 0 | |
{name, 0} -> def unquote(name)(), do: apply(:queue, unquote(name), []) | |
{name, 1} -> def unquote(name)(x), do: apply(:queue, unquote(name), [x]) | |
{name, 2} -> def unquote(name)(x,y), do: apply(:queue, unquote(name), [y, x]) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment