Completed
Details
Assignee
UnassignedUnassignedReporter
Chad TaylorChad TaylorLabels
Approval
OkPatch
Code and TestPriority
TrivialAffects versions
Fix versions
Details
Details
Assignee
Unassigned
UnassignedReporter
Chad Taylor
Chad TaylorLabels
Approval
Ok
Patch
Code and Test
Priority
Affects versions
Fix versions
Created February 18, 2014 at 4:39 AM
Updated September 7, 2017 at 10:25 PM
Resolved September 7, 2017 at 10:25 PM
The
doc
macro supports three special cases, mapping&
tofn
,catch
totry
, andfinally
totry
. However, the macro does not currently expand these cases - it executes them like a function instead. This is evident if you use the following at a REPL:user> (macroexpand '(doc try)) ;; ok ((var clojure.repl/print-doc) ((var clojure.repl/special-doc) (quote try))) user> (macroexpand '(doc catch)) ;; broken ;; -- unexpectedly prints try doc -- ;; nil user> (= (with-out-str (doc catch)) (with-out-str (doc try))) ;; broken, expect true ;; -- unexpectedly prints try doc -- ;; false
Workaround: Call
doc
with the symbol to which the special case is mapped,fn
ortry
.Cause: Incorrect quoting when handling special cases in
doc
macroSolution: Update special case quoting approach to match the other cases.
Patch: CLJ-1358.patch