[racket] generating 0 or more than 1 additions in the body of for/list, for/vector, for/hash
The function is in racket/sequence (might only be available in the
next release, I'm not sure.)
Jay
2011/4/15 Mark Engelberg <mark.engelberg at gmail.com>:
> Where is this sequence->list function of which you speak?
>
> Did you mean the stream->list function, which despite its name,
> actually behaves like you'd expect a function called sequence->list
> function to behave?
>
> On Fri, Apr 15, 2011 at 12:30 PM, Jay McCarthy <jay.mccarthy at gmail.com> wrote:
>> I thought of something else you can do
>>
>> (sequence->list
>> (in-generator
>> (for ([e (in-list l)])
>> (if (f e)
>> (if ...
>> (begin (yield 1) (yield 2))
>> (yield 3))
>> (void)))))
>>
>> I've done that a few times
>>
>
--
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay
"The glory of God is Intelligence" - D&C 93