Re: Lazy map implementation

2010-05-28 Thread Sean Devlin
Can memoize do the job for you?

On May 28, 10:39 am, Robert Luo robort...@gmail.com wrote:
 I need a lazy map in my compojure based application to inject data
 into handlers. I searched the web for an implementation, I got one
 from Meikel which was written in 2008. Is there any recommendation?

 Thanks.

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


Re: Lazy map implementation

2010-05-28 Thread Robert Luo

On 5月28日, 下午11时01分, Sean Devlin francoisdev...@gmail.com wrote:
 Can memoize do the job for you?

No. What I need is something can act as a map to replace the request
map in compojure/ring so that it can be used in any middleware/
handles.

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


Re: Lazy map implementation

2010-05-28 Thread Joost
On May 28, 4:39 pm, Robert Luo robort...@gmail.com wrote:
 I need a lazy map in my compojure based application to inject data
 into handlers. I searched the web for an implementation, I got one
 from Meikel which was written in 2008. Is there any recommendation?

 Thanks.

I don't really see what you're trying to do with this, but as an
alternative, you can assoc lazy-seqs to a standard map. That is, if
your values are going to be seqs (IME, most of the things you want
lazy evaluation for are).

Joost.

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


Re: Lazy map implementation

2010-05-28 Thread Meikel Brandmeyer
Hi,

On Fri, May 28, 2010 at 07:39:55AM -0700, Robert Luo wrote:
 I need a lazy map in my compojure based application to inject data
 into handlers. I searched the web for an implementation, I got one
 from Meikel which was written in 2008. Is there any recommendation?

Just FYI:
It's still maintained and will soon move to deftype to be ready
for 1.2. Then I will also put a release on Clojars.

Sincerely
Meikel

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


Re: Lazy map implementation

2010-05-28 Thread Robert Luo


 Just FYI:
 It's still maintained and will soon move to deftype to be ready
 for 1.2. Then I will also put a release on Clojars.

 Sincerely
 Meikel

Thanks Meikel, I will try your implementation in my application.

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


Re: Lazy map implementation

2010-05-28 Thread Robert Luo

On 5月29日, 上午12时50分, Joost jo...@zeekat.nl wrote:


 I don't really see what you're trying to do with this, but as an
 alternative, you can assoc lazy-seqs to a standard map. That is, if
 your values are going to be seqs (IME, most of the things you want
 lazy evaluation for are).

 Joost.

The reason is very simple:

Existing code base (ring) choose map as the data structure, I want my
new feature seamless merge into it, then I can use all the existing
functions, and new codes become normal citizen in the design.

The reason I ask is that I think this is so common a need, and its
idea fits into clojure's philosophy. I do not want to reinvent wheels
on a common need.

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