Skip to content

Instantly share code, notes, and snippets.

@dwhelan
Created March 2, 2018 06:41
Show Gist options
  • Save dwhelan/f3dfbf8b4927099c03e750e5c7f034f8 to your computer and use it in GitHub Desktop.
Save dwhelan/f3dfbf8b4927099c03e750e5c7f034f8 to your computer and use it in GitHub Desktop.
Print generated Elixir code in a macro to stdio
defmodule Something do
defmacro __using__(opts) do
x = quote do
import unquote __MODULE__
@behaviour Doit.Processor
unquote build_process_funs(opts, __CALLER__)
end
# x |> Macro.expand(__ENV__) |> Macro.to_string |> IO.puts
x
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment