How to reuse a macro like a function https://www.thoughtfull.systems/notes/2025-05-30-how-to-reuse-a-macro-like-a-function/ #clojure
If you're doing this inside a macro then you have &form and &env available, so you can just pass them through directly.
Also, fun fact: vars called as functions automatically deref themselves, so you don't need an @ for them.
With both these changes, the code becomes:
(defmacro defn+ [& args]
(let [[_def name [_fn & arities]] (apply #'defn &form &env args)
improved-arities (improve-the-arities arities)]
`(def ~name (fn ~@improved-arities))))