+1, this behaviour of stream-cons of racket/stream definitely is wrong. Jos
> -----Original Message----- > From: users-boun...@racket-lang.org > [mailto:users-boun...@racket-lang.org] On Behalf Of Eugene Toder > Sent: 05 March 2011 21:37 > To: users@racket-lang.org > Subject: [racket] stream-cons from racket/stream isn't lazy > > Hello, > > stream-cons from racket's standard racket/stream.rkt is implemented as > a macro -stream-cons wrapped into a case-lambda. > This wrapping makes it strict in both arguments, contrary to the > traditional behaviour from SICP, srfi-40, srfi-41 etc. > For example: > > > (define (foo) (display "called\n") empty-stream) > > (stream-cons 1 (foo)) > called > #<sequence> > > (require srfi/41) > > (stream-cons 1 (foo)) > #<stream> > > Is this intentional? Is there a way to get traditional lazy behaviour > other than by implementing it with make-do-sequence or generator? > > Eugene > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users