On 12 Jul 2010, at 16:13, aria42 wrote:

> Is there a way to set up a map so that there is a default function
> which depending on the key returns a value if one is not present in
> the map. I can obviously write this with a deftype and have it
> implement Associative, Seqable, etc. so it behaves like a built-in
> map, but just wondering if there was a way to get this out-of-the-box.


I imagine fnmap would make this easy to do:

 http://richhickey.github.com/clojure-contrib/fnmap-api.html

-Steve

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