Created
March 17, 2019 15:29
-
-
Save tonyc/3c6bd28bd25ece194a700ff6f9662ccb 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
IO.inspect(quote do | |
defmodule QuoteTest do | |
def test(:foo), do: :foo | |
def test(:bar), do: :bar | |
def test(_), do: :anything | |
end | |
end) | |
### output | |
{:defmodule, [context: Elixir, import: Kernel], | |
[ | |
{:__aliases__, [alias: false], [:QuoteTest]}, | |
[ | |
do: {:__block__, [], | |
[ | |
{:def, [context: Elixir, import: Kernel], | |
[{:test, [context: Elixir], [:foo]}, [do: :foo]]}, | |
{:def, [context: Elixir, import: Kernel], | |
[{:test, [context: Elixir], [:bar]}, [do: :bar]]}, | |
{:def, [context: Elixir, import: Kernel], | |
[{:test, [context: Elixir], [{:_, [], Elixir}]}, [do: :anything]]} | |
]} | |
] | |
]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment