On Jan 18, 2011, at 5:38 PM, Lee Spector wrote:

> If I recall correctly the lack of nil defaults was indeed one of the things 
> that I didn't like about records (I think this was leading to exceptions in 
> my code until I patched around it), and it's even possible that the IFn thing 
> meant that I had to flip some code around.

You might find my minor sugar for defining records whose slots have default 
values:

http://cemerick.com/2010/08/02/defrecord-slot-defaults/

Also worth noting is the further enhancement by Michael Fogus (linked to in the 
comments on the above post) that adds support for kwargs to the factory 
function for the defined record.

I also like a few aspects of what structmaps provide vs. regular maps (in 
particular, documentation of intent), but records have too many far more 
significant advantages and are too easy to add sugar to to reclaim the minor 
bits structmaps offer to not use IMO.

Cheers,

- Chas

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