On Tue, May 31, 2011 at 11:30 AM, David McNeil <mcneil.da...@gmail.com> wrote:
> A couple of aspects of records that I have found useful:
>
> * they provide a type for dispatching. Rather than rooting around in
> the map to find out what it is, a multi-method can dispatch directly
> on the type of the object.

And you can use a protocol, which dispatches very efficiently on the
type of the object if the record is declared at creation time as
implementing the protocol.

However the OP indicated he wasn't using protocols (or, presumably,
multimethods) with his records in this *particular* instance.

> * having a central definition of the main keys contained in the
> structure is sometimes nice for defining an apps data structures

This is a point; a defrecord can be useful as documentation within the
code, all other things being equal.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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

Reply via email to