<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.0.6249.1">
<TITLE>[plt-scheme] Dead lock using map-stream?</TITLE>
</HEAD>
<BODY dir=ltr>
<DIV>First of all, what good would that thing do?</DIV>
<DIV>map-stream calls proc for each element of the stream, or in other
words, calls (+ 0), (+ 1), etc. and streams them.</DIV>
<DIV>Second, does (enumerate-interval 0 10) work?</DIV>
<DIV> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><FONT size=2>-----Original Message----- <BR><B>From:</B> Gurpreet S.
Saini [mailto:gsaini@u.washington.edu] <BR><B>Sent:</B> א 23/11/2003 05:08
<BR><B>To:</B> plt-scheme@list.cs.brown.edu <BR><B>Cc:</B> <BR><B>Subject:</B>
[plt-scheme] Dead lock using map-stream?<BR><BR></FONT></DIV>
<P><FONT size=2> For list-related administrative tasks:<BR> <A
href="http://list.cs.brown.edu/mailman/listinfo/plt-scheme">http://list.cs.brown.edu/mailman/listinfo/plt-scheme</A><BR><BR>[Note
that both of definitions come from chapter 3 of<BR>the first edition of
SICP]<BR><BR>Consider<BR><BR>1. the following defintions:<BR><BR>(define
the-empty-stream '())<BR><BR>(define (enumerate-interval low
high)<BR> (if (> low
high)<BR>
the-empty-stream<BR>
(cons-stream
low<BR>
(enumerate-interval (+ low 1) high))))<BR><BR>(define (map-stream proc
stream)<BR> (if (empty-stream?
stream)<BR>
the-empty-stream<BR>
(cons-stream (proc (head
stream))<BR>
(map-stream proc (tail stream)))))<BR><BR>2. And the following
call:<BR><BR>(map-stream + (enumerate-interval 0 10))<BR><BR>Right now this
call is stalled. It looks to me like<BR>this is supposed to happen. This is
because both enumerate-interval and<BR>map-stream's call to tail is in a
cons-stream.<BR><BR><BR>thanks<BR>--Gurp<BR><BR><BR><BR><BR><BR><BR><BR><BR><BR></FONT></P></BLOCKQUOTE>
</BODY>
</HTML>