Path: utzoo!attcan!uunet!husc6!uwvax!rutgers!bellcore!tness7!killer!pollux!ti-csl!mips!gateley
From: gateley@mips.csc.ti.com (John Gateley)
Newsgroups: comp.lang.scheme
Subject: Re: collect special form for streams
Message-ID: <50472@ti-csl.CSNET>
Date: 31 May 88 21:01:46 GMT
References: <294@gt-eedsp.UUCP>
Sender: root@ti-csl.CSNET
Reply-To: gateley@mips.UUCP (John Gateley)
Distribution: na
Organization: TI Computer Science Center, Dallas
Lines: 14
Posted: Tue May 31 16:01:46 1988

In article <294@gt-eedsp.UUCP> schw@gt-eedsp.UUCP (Dave Schwartz) writes:
>How can the "collect" special form for streams (from Chap. 3 of
>Structure and Interpretation of Computer Programs) be implemented for
>TI PC-Scheme? I have Kent Dybvig's "extend-syntax," but this does not
>appear to be powerful enough for this special form.

Extend-syntax's pattern matching is not powerful enough to do this.
You have to use the "with" feature to generate the v functions. (by calling
a function which builds them, i.e. you do them by hand). I also used a
help macro to make the flatmap parts of the expression (watch out for
keywords). If this is not enough help, email me and I will send you my code.

John Gateley
gateley@tilde.csc.ti.com