On Jul 4, 8:04 am, arasoft <t...@arasoft.de> wrote:
> Using a fairly recent 1.1 snapshot, I get an OutOfMemoryError for
> this:
>
> (defn fib-seq []
>     ((fn more [a b]
>         (lazy-seq (cons a (more b (+ a b)))))
>      0 1)
> )
>
> (nth (fib-seq) 200000)
>
> However, this works fine:
>
> (defn xth [coll i]
>   (if (zero? i) (first coll) (recur (rest coll) (dec i))))
>
> (xth (fib-seq) 200000)
>
> Am I doing anything wrong, or is this a bug?

A recent optimization attempt introduced a head-retaining hop in
RT.nth, now removed. Thanks for the report!

http://github.com/richhickey/clojure/commits/master

Rich

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