2011/2/16 Sunil S Nandihalli <sunil.nandiha...@gmail.com> > Just thinking out loud... > After listening to "classes are a premature optimization" lecture on infoQ > .. I was just wondering if the only purpose of defrecord is space&speed > efficiency ... and could just use maps .. ofcourse .. I won't be able to use > the protocols ..defrecord may improve the readability in terms of what keys > to expect .. Am I missing something? > Sunil. >
If I remember correctly, the essence of the existence of defprotocol and deftype is to be able to (re)write more clojure in clojure. A first step having been to create deftype and defprotocol, to map as closely as possible to the host's VM perfs in terms of space and speed. defrecord was added as a convenience a little later. I still tend in my code to not use protocols and types much, and if so, confine their use as "implementation details" of my libs (or well delimited parts of my apps) for polymorphism. -- 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