The docstring for defn is:
Same as (def name (fn [params* ] exprs*)) or (def name (fn ([params* ] exprs*)+)) with any doc-string or attrs added to the var metadata. prepost-map defines a map with optional keys re and ost that contain collections of pre or post conditions.
The arglist is:
(defn name doc-string? attr-map? [params*] prepost-map? body)
There are two issues that made this docstring hard to understand for me:
1. The docstring does not mention attr-map? - it took me a a bit of jumping around the docs to make the leap from attr-map? to "with any [...] attrs added to the var metadata".
2. The docstring makes reference to exprs*, but the arglist refers to body.
Patch welcome, would appreciate smallest change possible.
I've attached a patch to address two issues:
change 'exprs*' to 'body' to match the arglist.
change 'body+)' to 'body)+' when referring to the multi-artiy form.
I didn't address "any attrs" referring to attr-map, I wasn't sure the most "Clojury" way to phrase it.
Seems like the body change is missing a trailing right paren?
You have: (def name (fn ([params* ] body)+)
Should be: (def name (fn ([params* ] body)+))
Hi @marc, any updates? It would be lovely to get this in Thanks!