ah...but does for 10000

On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote:
>
> It doesn't overflow for me.
>
>
> user=> (first (drop 1000 (iterate (partial map inc) (range 10))))
> (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009)
>
>
> On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote:
>>
>> Can someone explain why 
>> ... iterating over a sequence cause a stack overflow 
>> (first (drop 1000 (iterate (partial map inc) (range 10)))) -> 
>> java.lang.StackOverflowError 
>>
>> ...but iterating over a vector works ok? 
>> (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10)))) - 
>> > [1000 1001 1002 1003 1004 1005 1006 1007 1008 1009] 
>>
>

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