John Harrop <jharrop...@gmail.com> writes:

Hi John,

>> Although that doesn't really help, the normal `reduce' doesn't do
>> better.
>>
>> (reduce + (take 1000000 (iterate inc 1)))  ; works
>> (reduce + (take 10000000 (iterate inc 1))) ; OutOfMemoryError
>
> Are you sure? I'd expect that with
>
> (def integers (iterate inc 1))
> (reduce + (take 10000000 integers))
>
> but not with what you wrote.

Hm, now I cannot reproduce it anymore, and it still works even when
taking more from the lazy seq.  Seems like I really used the integers
def and didn't post what I really tried.  Bad boy!  As an excuse, in the
meantime I updated clojure (which was quite dated), so maybe it's not
all my fault. ;-)

Bye,
Tassilo

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

Reply via email to