Yes, very similar to lisp.
defmacro mydef(fun, args) do
quote do
def unquote(fun)(unquote(args)) do
MyModule.unquote(fun)(unquote(args))
end
end
end
This is an overly simplistic implementation but it might be enough for your needs.
Take a look at the implementation of the defdelegate macro and you’ll see it’s basically doing the same thing as the code above - only more generalised.


















