Hi,

On 15 Okt., 19:09, "Graham Fawcett" <[EMAIL PROTECTED]> wrote:
> >  (map f coll (range (count coll)))
>
> Rather than (range (count coll)), I would use (iterate inc 0), which
> incurs no overhead for counting the argument.

There is not only the overhead of counting, (count coll) might
also destroy the laziness of the collection.

user=> (count (for [i (range 3)] (do (println i) i)))
0
1
2
3

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