On Tue, Dec 2, 2008 at 6:38 PM, Chouser <[EMAIL PROTECTED]> wrote:

>
> On Tue, Dec 2, 2008 at 3:52 PM, Mark Volkmann <[EMAIL PROTECTED]>
> wrote:
> >
> > (def my-string (print-dup [1 2 3]))
> > (def my-data (read my-string))
> >
> > Can you give a simple example of serializing and deserializing a
> > Clojure collection?
>
> For "serializing" you have a couple options:
> (def my-string (binding [*print-dup* true] (pr-str [1 2 3])))
> (def my-string (with-out-str (print-dup [1 2 3] *out*)))
>
> I don't know which is "better".


The former (binding *print-dup*) is better and the only way to ensure things
work correctly in aggregates.

Rich

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to