Maintain the arglist metadata for helpers

This should hopefully make documentation via clojure.repl/doc and
others a bit more readable.
This commit is contained in:
Gary Fredericks 2014-05-01 17:26:33 +00:00
parent 88bc556578
commit edd268ae7d

View file

@ -10,11 +10,14 @@
(let [kw (keyword (name helper))]
`(do
(defmethod build-clause ~kw ~(into ['_] arglist) ~@more)
(defn ~helper [& args#]
(doto (defn ~helper [& args#]
(let [[m# args#] (if (map? (first args#))
[(first args#) (rest args#)]
[{} args#])]
(build-clause ~kw m# args#))))))
(build-clause ~kw m# args#)))
;; maintain the original arglist instead of getting
;; ([& args__6880__auto__])
(alter-meta! assoc :arglists '(~arglist))))))
(defn collify [x]
(if (coll? x) x [x]))