Andre Henriques
33281da43f
All checks were successful
continuous-integration/drone/push Build is passing
32 lines
471 B
Elixir
32 lines
471 B
Elixir
defmodule Test do
|
|
|
|
defmacro createfuncBase(name, do: do_exp, else: else_exp) do
|
|
b1 = quote do
|
|
false -> unquote(else_exp)
|
|
end
|
|
|
|
b2 = b1 ++ do_exp
|
|
|
|
t = quote do
|
|
def test(v) do
|
|
case v do
|
|
unquote(b2)
|
|
end
|
|
end
|
|
end
|
|
|
|
IO.puts("test #{inspect(t)}")
|
|
|
|
t
|
|
end
|
|
|
|
end
|
|
|
|
defmodule Test2 do
|
|
require Test
|
|
|
|
Test.createfuncBase :lol do
|
|
true -> :test
|
|
else :test1 end
|
|
end
|