<< Previous exercise (3.50)
| Index |
Next exercise (3.52) >>
(define (show x)
(define x (stream-map show (stream-enumerate-interval 0 10)))
(stream-ref x 5)
(stream-ref x 7)
I get a different result. On Racket, with all of the procedures implemented exactly as specified in the book, I get:
racket@> (define x
(stream-enumerate-interval 0 10)))
10racket@> (stream-ref x 5)
racket@> (stream-ref x 7)
The only thing which could possibly account for this discrepancy is a mistake in my implementation of delay, but it looks fine to me?
(define delay (lambda (proc) (memo-proc (lambda () proc))))
Any idea why I get different results?
EDIT: After solving the next exercise and looking at other solutions, it seems like the evaluations aren't actually being delayed, could it be some aspect of Racket's implementation which is preventing it from working?