[plt-scheme] Dead lock using map-stream?

From: Dor Kleiman (dor at ntr.co.il)
Date: Sun Nov 23 05:37:19 EST 2003

First of all, what good would that thing do?
map-stream calls proc for each element of the stream, or in other words, calls (+ 0), (+ 1), etc. and streams them.
Second, does (enumerate-interval 0 10) work?

	-----Original Message----- 
	From: Gurpreet S. Saini [mailto:gsaini at u.washington.edu] 
	Sent: א 23/11/2003 05:08 
	To: plt-scheme at list.cs.brown.edu 
	Subject: [plt-scheme] Dead lock using map-stream?

	  For list-related administrative tasks:
	[Note that both of definitions come from chapter 3 of
	the first edition of SICP]
	1. the following defintions:
	(define the-empty-stream '())
	(define (enumerate-interval low high)
	        (if (> low high)
	            (cons-stream low
	                        (enumerate-interval (+ low 1) high))))
	(define (map-stream proc stream)
	    (if (empty-stream? 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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20031123/43e77269/attachment.html>

Posted on the users mailing list.