Hello,

when running any of the following the program runs out of memory:

#lang racket/base
(require racket/stream)

(stream-ref (let ([i 0])(stream-cons i (let loop ()(set! i (+ i 1))(stream-cons 
i (loop)))))
            20000000)
(stream-ref (for/stream ([i (in-naturals)]) i)
              20000000)

I guess this is because of memoization, but I was hoping that since I don't 
keep a reference to the first element of the stream, it would be discarded. 
This doesn't seem to be happening.
Is there a way to disable memoization for streams? Or is there an other 
issue?

(the actual stream I want to build/traverse without keeping it in memory is 
at http://pasterack.org/pastes/63574)

Kind regards,
Bert

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to