Kernel.defmacro
You're seeing just the macro
defmacro
, go back to Kernel module for more information.
Defines a public macro with the given name and body.
Macros must be defined before its usage.
Check def/2
for rules on naming and default arguments.
Examples
defmodule MyLogic do
defmacro unless(expr, opts) do
quote do
if !unquote(expr), unquote(opts)
end
end
end
require MyLogic
MyLogic.unless false do
IO.puts("It works")
end