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:
parent
88bc556578
commit
edd268ae7d
1 changed files with 8 additions and 5 deletions
|
|
@ -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]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue