Re: Maps with functions for default values

2010-07-12 Thread Steve Purcell
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 l

Maps with functions for default values

2010-07-12 Thread aria42
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 w