We have two main reasons for this:
1) defmacro cannot be private and private/public gave a general
feeling that we could simply mark macros as private;
2) public/private works poorly with quoting. Imagine a macro that
wants to define some method as private:
quote {
private
def foo, do: bar
}
This call to private would alter all the functions in the target
module.
In order to solve 2), we would have to either allow private with a block:
quote {
private do
def foo, do: bar
end
}
Or use `private(opts)`:
quote {
def foo, do: bar
private foo: 1
}
However, none of these approaches explicitly solves 1). That's why we decided
to go with a syntax similar to Clojure's `def-`: defp.
quote {
defp foo, do: bar
}
There is no `defmacrop`, which solves 1), and the visibility always apply
only to the current function, solving 2).