I am working on understanding how to write macros. In https://hexdocs.pm/elixir/macros.html this example module is given:
defmodule Unless do
def fun_unless(clause, do: expression) do
if(!clause, do: expression)
end
defmacro macro_unless(clause, do: expression) do
quote do
if(!unquote(clause), do: unquote(expression))
end
end
end
In this example “do: expression” seems to be what might be called a keyword parameter. Unfortunately, I’m not able to find any documentation that explains this syntax for function parameters. Would someone mind pointing me in the right direction? Thanks