-
-
Save StevenXL/268d3750b14d26c2a1e84bd4f92403cb to your computer and use it in GitHub Desktop.
Metaprogramming - Context
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 UseMacro do | |
use DefineMacro | |
end | |
defmodule DefineMacro do | |
defmacro __using__(_opts) do | |
IO.inspect __MODULE__ # DefineMacro | |
quote do | |
IO.inspect __MODULE__ #UseMacro | |
IO.inspect unquote(__MODULE__) #DefineMacro | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment