[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: collect special form for streams
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.