On Jun 16, 1:07 pm, Christophe Grand <christo...@cgrand.net> wrote:
> Graham Fawcett a écrit :> Yet it leaks memory: calling (nth fib-seq N) for a large N results inHm, sadly it does not work: I still run out of heap space, running
> > an OutOfMemoryError.
> What you get is a java.lang.OutOfMemoryError: Java heap space and not a
> > I know that the JVM does not offer tail-call optimization, but is
> Turning the seq into a fn will allow it to be reclaimed and thus the
> (defn fib-seq
> (let [r (nth (fib-seq) 100000)] r)
this version of the code.
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.