The limitation is that the macro must have a single valid name and return a single expression. It can't for instance tack something onto the end of the expression before it in the calling namespace, nor can it return two expressions to be inserted into the calling namespace sequentially (without making it one expression by wrapping it in a do
. You could write a macro to define lots of macros:
(defmacro make-printers [& names]
`(do ~@(for [name names]
`(defmacro ~(symbol (str "myprintln-" name)) []
(println ~(str name))))))
user> (make-printers foo bar)
#'user/myprintln-bar
user> (myprintln-foo)
foo
nil
user> (myprintln-bar)
bar
nil
Macros are just functions that return an s-expression. That expression can be anything so long as it is a valid s-expression (function arg arg ...). The name of the macro must match exactly for the macro to be called, so the name of the macro cannot be part of the macro. You can get close to what you are asking about with the new extensible reader feature though it's not quite what you need.
ps: It is worth pointing out that this example violates the first rule of macro club and is "unhygenic"