[racket] generating 0 or more than 1 additions in the body of for/list, for/vector, for/hash

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Apr 15 16:09:39 EDT 2011

40 minutes ago, Jay McCarthy 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

[It would be very slow compared to the direct loops.]

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.