On Nov 17, 3:50 pm, Adam Jones <[EMAIL PROTECTED]> wrote:
> On Nov 17, 3:26 pm, Robert Ewald <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > Doing some small experiments I stumbled over map returning a lazy seq 
> > instead
> > of performing the function. I had to convert that to a doseq. Is there any
> > rationale for not having an eager map. Or was I just not reading the docs
> > properly?
>
> Many of Clojure's functions that operate on seqs have this property.
> The idea is to capture the space efficiency of lazy list processing by
> default. If you really need strict evaluation, wrap the map with
> doall. I'm guessing that strict equivalents aren't provided to
> encourage the use of the lazy functions unless they absolutely aren't
> needed.

What is the preferred idiom for converting from a Lazy seq to a proper
seq?
I've been using (into [] (map .....)).
doall and dorun don't really appeal to me in this usage, because to me
they say "This code is lazy and I'm executing it for side effects, not
results".  (into []...) says to me "This code is lazy, and I really
want a concrete vector here.

Thoughts?

Cheers,
Brad

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to