Lazy map?

13 views
Skip to first unread message

Serge Wroclawski

unread,
Apr 21, 2009, 10:34:41 AM4/21/09
to Clojure Study Group Washington DC
I was describing the current state of the project with a friend (who
lurks on this list actually) and he asked an interesting question:

If we're going to encourage lazy records, why not lazy maps?

I wasn't aware of such a thing, but here it is:

http://kotka.de/projects/clojure/lazy-map.html

I'm still working on some trivial examples before I post them to the github.

- Serge

Luke VanderHart

unread,
Apr 21, 2009, 9:59:14 PM4/21/09
to Clojure Study Group Washington DC
Very cool... I didn't know this existed.

Not sure of the actual utility of it in our scenario, unless you had a
map with some really huge values that it would be beneficial to put
off retrieving.

But the good news is, that if anyone wants to use these lazy maps,
they should work great out of the box, since they fully implement the
map interface.

Thanks for pointing this out!

-Luke

Serge Wroclawski

unread,
Apr 21, 2009, 10:17:34 PM4/21/09
to clojure-...@googlegroups.com
On Tue, Apr 21, 2009 at 9:59 PM, Luke VanderHart
<luke.va...@gmail.com> wrote:
>
> Very cool... I didn't know this existed.

There's also clojure.contrib.map-utils which contains a lazy-get.

> Not sure of the actual utility of it in our scenario, unless you had a
> map with some really huge values that it would be beneficial to put
> off retrieving.

I questioned the utility as well, but there are a lot of questions
still on the table about the utility of many of the language features.

I think one of the things we'll want to do later on in the process is
write performance tests to see where slowdowns occur and if using
things like lazyness or wrapping multiple input paths into agents
makes a difference, or seeing the effect of putting caching systems at
various points makes.

- Serge

Reply all
Reply to author
Forward
0 new messages