<< Previous exercise (4.17) | Index | Next exercise (4.19) >>


 this won't work. because, in (let ((a <e1>) (b <e2>))), when compute e2, it depends y, but we only have a not y. For the same reason, the solution in text will work. 


I think both method will work, because (eval "dy") is 'delayed'.
But the expression "(stream-map f y)" defined in dy will be evaluated while y hasn't been defined yet.
So former method won't work.

Intitially, I too thought both methods would work, I can imagine a 'very lazy' implementation of stream-map the doesn't evaluate its arguments at all until the first element of the stream is requested.  But SICP's streams are definately not that lazy as they evaluate the first element of the stream immediately.  So y will be evaluated when (stream-map f y) is evaluated.