Karl, > It is a common mistake to think that callability, corresponding to the > clojure.lang.IFn interface, is part of the persistent map contract > (I've done it myself, as did many others a Conj labs :). It is not. It > is actually just a feature of clojure.lang.PersistentHashMap (and the > other clojure map implementations). > > I haven't looked at the compiler, but I think that defrecord creates a > class that implements clojure.lang.IPersistentMap (among others). > > Note, Christophe pointed out to me: this is also relevant when you are > extending a protocol to clojure.lang.IPersistentMap: don't rely on > callability when accessing the map (this was the mistake I made).
Makes sense. Thanks, Karl. Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- 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