[plt-scheme] Dead lock using map-stream?
[Note that both of definitions come from chapter 3 of
the first edition of SICP]
Consider
1. the following defintions:
(define the-empty-stream '())
(define (enumerate-interval low high)
(if (> low high)
the-empty-stream
(cons-stream low
(enumerate-interval (+ low 1) high))))
(define (map-stream proc stream)
(if (empty-stream? stream)
the-empty-stream
(cons-stream (proc (head stream))
(map-stream proc (tail stream)))))
2. And the following call:
(map-stream + (enumerate-interval 0 10))
Right now this call is stalled. It looks to me like
this is supposed to happen. This is because both enumerate-interval and
map-stream's call to tail is in a cons-stream.
thanks
--Gurp