*print-pprint-dispatch* is a Clojure dynamic variable containing the multimethod that selects a pretty-printing strategy from an object’s type. Its default value is clojure.pprint/simple-dispatch, which formats common Clojure data structures for human-readable output. section 23.20
Bind it locally when output needs another formatting strategy. clojure.pprint/code-dispatch formats Clojure source-like data, while with-pprint-dispatch provides a macro for the same local switch. section 23.20
Formatting a conditional expression
A normal pretty print spreads the form across many lines. Binding code-dispatch produces source-oriented indentation: (binding [pprint/*print-pprint-dispatch* pprint/code-dispatch] (pprint/pprint '(condp = x 1 "one" 2 "two" :else :none))) ;; (condp = x ;; 1 "one" ;; 2 "two" ;; :else :none)
