Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke
On Tuesday, 12 March 2019 19:21:12 UTC+1, Ben Greenman wrote: > > You can also use sequences: > > #lang racket/base > (require racket/sequence) > > (sequence-ref (in-producer (let ([i 0]) (lambda () (begin0 i (set! i > (+ i 1)) > 2000) > (sequence-ref (in-naturals) >

Re: [racket-users] out of memory with streams

2019-03-12 Thread Ben Greenman
You can also use sequences: #lang racket/base (require racket/sequence) (sequence-ref (in-producer (let ([i 0]) (lambda () (begin0 i (set! i (+ i 1)) 2000) (sequence-ref (in-naturals) 2000) -- You received this message because you are subscribed to the Go

Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke
On Tuesday, 12 March 2019 16:06:59 UTC+1, Matthias Felleisen wrote: > > > > > On Mar 12, 2019, at 10:48 AM, bedeke > > wrote: > > > > > > Sorry for not being clear. > > I knew that increasing the memory limit could make this run without > problems since the data in each cell of the stream i

Re: [racket-users] out of memory with streams

2019-03-12 Thread Matthias Felleisen
> On Mar 12, 2019, at 10:48 AM, bedeke wrote: > > > Sorry for not being clear. > I knew that increasing the memory limit could make this run without problems > since the data in each cell of the stream is so small. > I was running this example with a memory limit of 128MB. > I made my own qu

Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke
On Tuesday, 12 March 2019 14:50:38 UTC+1, Matthias Felleisen wrote: > > > > On Mar 12, 2019, at 3:10 AM, bedeke > > wrote: > > 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 (

Re: [racket-users] out of memory with streams

2019-03-12 Thread Matthias Felleisen
> On Mar 12, 2019, at 3:10 AM, bedeke wrote: > > 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) > 2000

[racket-users] out of memory with streams

2019-03-12 Thread bedeke
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) 2000) (stream-ref (for/stream ([i (in-naturals)]) i) 2000