On 7/22/12 5:42 PM, Warren Lynn wrote:
I plan to change all my major data structures to records instead of plain maps. Since record has everything a map provides, I figure there won't be any harm. But is that really so? Would appreciate the opinions from people who know better.
Another downside I have ran into that hasn't been mentioned is with (Java) serialization. If you are using records and defining protocols inline you can serialize the record just fine, however if you change the implementation then all of your old serialized records are incompatible even if the change was superficial. The Java solution to this problem is to define a 'static final long serialVersionUID' however AFAIK there is no way to define this on a Clojure record. (If someone knows better please let me know since loosing data after every protocol change is very annoying...) If you use multi-methods instead of protocols you won't run into this issue.
-Ben -- 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