[plt-scheme] Stream comprehensions

From: Grant Rettke (grettke at acm.org)
Date: Mon Jul 2 17:39:58 EDT 2007

Is your son as interested in learning how to implement lazy lists as
he is in using them?

That would probably answer your question for you.

On 7/2/07, Mark Engelberg <mark.engelberg at gmail.com> wrote:
> So a few months ago, my son started working on the Project Euler
> problems in Scheme.  After solving a few of the problems, he
> particularly enjoyed going through the forums, asking me to explain to
> him the solutions in the other programming languages.  He was struck
> by the brevity of the Haskell solutions, and begged me to teach him
> some Haskell.
> So for the past couple of months, he's been working the problems in Haskell.
> Now, I'm trying to move him back to Scheme to continue Htdp; problem
> is, he's been spoiled by some of the niceties of Haskell.  In
> particular, the ease of working with large or possibly infinite lists
> lazily, and using comprehensions to express complex cartesian
> products, maps and filters elegantly.
> Swindle's comprehension syntax is extremely close to Haskell's, so
> this is a pretty easy switch.
> For lazy lists, there are a few possibilities.
> 1.  Use the streams in srfi40.
> 2.  Show him how to implement streams himself using force/delay.
> 3.  Switch to Lazy Scheme language level and use regular lists.
> The problem is that none of these options seem to interact well with
> comprehensions.
> So... does anyone know of a comprehension macro system for DrScheme
> that interacts seamlessly with streams?  Should I roll my own using
> the collect macro in swindle, or has this already been done?
> Thanks,
> Mark
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.