On Mon, Jul 13, 2009 at 1:25 PM, Mark Engelberg<mark.engelb...@gmail.com> wrote: > > Thanks for confirming the bug that struct-maps written with > *print-dup* bound to true cannot be read back in. So is this a bug > with the writer or the reader, or with the create method of struct > maps, or something else?
This is a known issue, but my understanding is that a complete solution is on hold pending a possible re-working of structs. > More specifically, I already have a bunch of > files containing data structures written with *print-dup* in Clojure > 1.0, and they are currently unreadable. Will I ever be able to read > them back in when the bug is fixed, or are these files unrecoverable? The current printed representation doesn't appear to include any reference to the original struct type. That is, the keys and values are there but not the defstruct that was used when the struct was created. So for now, print-dup doesn't support structs. If you want to use print-dup, I'd recommend using hash-map, array-map, or sorted-map instead. Note sorted-map-by doesn't appear to be supported either. To recover what data you can in your existing files, you could temporarily patch clojure.lang.PersistentTreeMap/create to produce hash-maps. --Chouser --~--~---------~--~----~------------~-------~--~----~ 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 Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---