Last active
June 24, 2016 00:12
-
-
Save moccos/ee28221890f0b7feab06 to your computer and use it in GitHub Desktop.
This file contains 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 Hoge do | |
@flag false | |
defmacro ifa(a, exp) do | |
if (Macro.expand_once(a, __CALLER__)), do: exp | |
end | |
def main do | |
if (@flag), do: IO.puts 123 | |
ifa (@flag), do: IO.puts 456 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment