How can I pretty print a PersistentHashMap in Clojure to a string? I am looking for something like:
(str (pprint {... hash map here...})
which
(let [s (java.io.StringWriter.)] (binding [*out* s] (clojure.pprint/pprint {:a 10 :b 20})) (.toString s))
Edit: Equivalent succinct version:
(with-out-str (clojure.pprint/pprint {:a 10 :b 20}))