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 47c040e75f
All checks were successful
continuous-integration/drone/push Build is passing
more work on the server
2024-01-16 23:46:30 +00:00

44 lines
595 B
Elixir

defmodule Test do
defmacro test() do
quote do
a = 1
end
end
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
def test2() do
a = 2
test
IO.puts("#{a}")
end
Test.createfuncBase :lol do
true -> :test
else :test1 end
end