On 14.02.2010, at 07:53, Mark Engelberg wrote: > After playing around, I think it would be ideal that if you *don't* > specify clojure.lang.IPersistentMap as an interface, you still get an > implementation of assoc that works only with keys already in the type. > In other words, you can't add a new field, and you can't call dissoc > to remove it, but you still have the ability to say, "Give me another > object just like this one, but with such-and-such value changed".
I agree that's often a useful behaviour to have, but on the other hand I would not want it automatically, because for some types I don't want anyone to mess around with my objects at a field-by-field level. For example if there are invariants among several field values that need to be maintained. Konrad. -- 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