[plt-scheme] Re: Lazy streams in SICP

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Thu May 18 12:44:20 EDT 2006

geb a wrote:
> In SICP, lazy streams are formulated as follows...
> (define (cons x y)
>   (lambda (m) (m x y)))
> (define (car z)
>   (z (lambda (p q) p)))
> (define (cdr z)
>   (z (lambda (p q) q)))
> (define ones (cons 1 ones))

That's not what it says:


> Running this code in mzscheme yields the following
> error: 
> reference to undefined identifier: ones
> I assume that there is some fundamental difference
> between mzscheme and MIT's version of scheme that
> causes this?  

Nope - you'll get the same result in MIT Scheme.



for a definition of cons-stream.

Jens Axel Søgaard

Posted on the users mailing list.