You're viewing version 1.2.0 of pprint. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (pprint object)
  • (pprint object writer)
Pretty print object to the optional output writer. If the writer is not provided,
print the object to the currently bound value of *out*.

1 Example top

  • user=> (def *map* (zipmap 
                        [:a :b :c :d :e] 
                        (repeat 
                          (zipmap [:a :b :c :d :e] 
                            (take 5 (range))))))
    #'user/*map*
    user=> *map*
    {:e {:e 4, :d 3, :c 2, :b 1, :a 0}, :d {:e 4, :d 3, :c 2, :b 1, :a 0}, :c {:e 4, :d 3, :c 2, :b 1, :a 0}, :b {:e 4, :d 3, :c 2, :b 1, :a 0}, :a {:e 4, :d 3, :c 2, :b 1, :a 0}}
    
    user=> (clojure.pprint/pprint *map*)
    {:e {:e 4, :d 3, :c 2, :b 1, :a 0},
     :d {:e 4, :d 3, :c 2, :b 1, :a 0},
     :c {:e 4, :d 3, :c 2, :b 1, :a 0},
     :b {:e 4, :d 3, :c 2, :b 1, :a 0},
     :a {:e 4, :d 3, :c 2, :b 1, :a 0}}
    nil
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/pprint/pprint_base.clj:241 top

(defn pprint 
  "Pretty print object to the optional output writer. If the writer is not provided, 
print the object to the currently bound value of *out*."
  {:added "1.2"}
  ([object] (pprint object *out*)) 
  ([object writer]
     (with-pretty-writer writer
       (binding [*print-pretty* true]
         (binding-map (if (or (not (= *print-base* 10)) *print-radix*) {#'pr pr-with-base} {}) 
           (write-out object)))
       (if (not (= 0 (get-column *out*)))
         (.write *out* (int \newline))))))
Used in 0 other vars

Comments top

No comments for pprint. Log in to add a comment.