This repository has been archived on 2024-01-29. You can view files and clone it, but cannot push or open issues or pull requests.
distributed_system_coursework/lib/test.ex
Andre Henriques 33281da43f
All checks were successful
continuous-integration/drone/push Build is passing
Lot of changes
2024-01-16 19:59:01 +00:00

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