Created
September 26, 2020 04:52
-
-
Save krainboltgreene/8b4ea24efd7f690ce6f03d72bf3a3105 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 Example do | |
defmacro example(block) do | |
quote do | |
def test(unquote(block)) do | |
IO.inspect(a) | |
end | |
end | |
end | |
end | |
defmodule Elpmaxe do | |
import Example | |
example(quote do | |
%{a: a} | |
end) | |
end | |
Elpmaxe.test(%{a: 1}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment