[CLJ-1215] Mention where to position docstring when using pre/postconditions on the Special Forms page Created: 07/Jun/13 Updated: 03/Sep/13 Resolved: 03/Sep/13
|Affects Version/s:||Release 1.5|
The description of pre- and post-conditions doesn't mention where docstring should be when using them. Placing it wrong will lead to the conditions to be ignored.
At http://clojure.org/Special%20Forms--(fn%20name?%20[params*%20]%20condition-map?%20exprs*), change
or at least mention it in the description or use it in the example.
|Comment by Alex Miller [ 03/Sep/13 8:59 AM ]|
The fn special form does not take a docstring so this modification is not valid. fn takes docstrings via meta.
The defn macro does take a docstring but it is placed prior to the attr-map, not after the condition map. The defn docstring does mention that the docstring will be added to the var metadata for the fn (not on the fn itself).