Return to Snippet

Revision: 12813
at March 29, 2009 18:40 by narkisr


Initial Code
; high-fidelity printing. You can get print-dup behaviour by binding *print-dup*: 
(def my-string (binding [*print-dup* true] (pr-str [1 2 3])))
; or using 
(def my-string (with-out-str (print-dup [1 2 3] *out*))) 

; de-serialization
(def my-data (with-in-str my-string (read)))

Initial URL

                                

Initial Description
print-dup is a multimethod which provides with readable serialization format for Clojure data structures (http://groups.google.com/group/clojure/browse_thread/thread/e704414cf36ef2aa).

Initial Title
Serializing Clojure data structures

Initial Tags

                                

Initial Language
Lisp