[plt-scheme] v4 questions
Eli Barzilay writes:
> > (define-syntax (for/stream stx)
> > [...])
>
> I have never seen a practical need for something like this (where by
> "this" I mean a general facility to turn a sequence of side-effects
> into a stream of values).
A for/stream expression doesn't have to involve side-effects-- it's
just a (potentially) more concise way to generate a stream. Compare
the following:
(for/stream ((x (in-naturals))) (f x))
(let loop ((x 0)) (stream-cons (f x) (loop (+ x 1))))
--dougorleans at gmail.com