defmodule Test do
defmacro test() do
quote do
a = 1
end
defmacro createfuncBase(name, do: do_exp, else: else_exp) do
b1 = quote do
false -> unquote(else_exp)
b2 = b1 ++ do_exp
t = quote do
def test(v) do
case v do
unquote(b2)
IO.puts("test #{inspect(t)}")
t
defmodule Test2 do
require Test
def test2() do
a = 2
test
IO.puts("#{a}")
Test.createfuncBase :lol do
true -> :test
else :test1 end