[plt-scheme] Question about delayed evaluation

From: Giannandrea Castaldi (g.castal at tiscali.it)
Date: Tue Mar 4 02:44:47 EST 2003

I'm studying "Structure and Interpretation of Computer Program" and in 
the third chapter are introduced streams. To improve the use of 
cpu/memory are introduced streams with delayed evaluation of the tail 
that are constructed with the use of a special form 'cons-stream' 
(cons-stream head tail) where  the head is evaluated at once while the 
tail is evaluated only when is accessed. I haven't found such a special 
form, does it exist or not?
I know that I can use delay,force,cons, car and cdr to implement streams 
with delayed evaluation but in this case the clients of the streams must 
pass to the cons operator a cdr argument already delayed (wrapped in a 
delay). I would like that clients don't know that streams have a delayed 
evaluation.

Giannandrea



Posted on the users mailing list.