2011/9/7 Nick Zbinden <nick...@gmail.com> > Solving the problem is easy. Just implment it by expaning the interface zu >set type. > The question we could ask know is why it it not included in the > standart record?
That was my question precisely. Or at least how I meant it. Also, Stuart answered it precisely. > Records have some things that probebly will be > addressed in future versions of clojure (standart constructur for > example) maybe making them callable will be something like that. No, it won't. To reiterate Stuart's answer: > This is by design. Function position indicates that the data structure is a > collection, not a (logical) record. IMO, that's an acceptable convention, analogous to defrecords only having keyword keys. But, like all conventions, it should be documented. >>> Aren't defrecords supposed to be drop-in specializations of maps? >> Where maps are used as records, but not where maps are used as >> collections. > I would be intressted to know why it was doen this way. Personlly I > don't mind either way. Personally, when I want to make dealing with collections explicit, I use (get coll x default?) But thinking about it, maps in function positions make a lot more sense for collection type maps, than for record type maps. Also, since you only ever have keyword keys in defrecords and (:kw rec) is a *very* established idiom in clojure, it makes sense to me to mandate keyword-first access for defrecords. kind regards -- __________________________________________________________________ Herwig Hochleitner -- 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