ClojureDocs

Nav

Namespaces

*print-pretty*

clojure.pprint

Available since 1.2
    Bind to true if you want write to use pretty printing
    1 Example
    (binding [clojure.pprint/*print-right-margin* 5]
    
      ;; Compare the two outputs below:
    
      (binding [clojure.pprint/*print-pretty* true]
        (clojure.pprint/write (range 3)))
      ; Prints:
      ; (0
      ;  1
      ;  2)
    
      (binding [clojure.pprint/*print-pretty* false]
        (clojure.pprint/write (range 3)))
      ; Prints:
      ; (0 1 2)
    )
    See Also
    No see-alsos for clojure.pprint/*print-pretty*
    1 Note
      By , created 6.6 years ago

      clojure.pprint/pprint always sets *print-pretty* to true internally, so changing it has no effect if you only use pprint and not write.