[racket] Combining iteration and match

From: Stephen Chang (stchang at ccs.neu.edu)
Date: Wed Sep 4 03:14:05 EDT 2013

>  > Like others have mentioned, my generic-bind package has the
>  > functionality you want but is still in the experimental stages. For
>  > small programs, the generic-bind for/_ forms are about as fast as the
>  > current Racket implementation but expect 2-3x slowdown for larger
>  > programs.
> Since the criterion seems to be the size of the program, do I conclude
> correctly that the slowdown concerns compile-time, rather than run-time?
> If not, what aspect of program size matters?

The 2-3x estimate was for runtime, in the case of for loops with many
iterations (ie millions). I've just pushed some optimizations though
that cut the slowdown to maybe 1.5-2x, in preliminary experiments. So
you should "pkg update" (or pull if you are using the source directly)
to get the changes.

In addition, you should expect a noticeable compile-time slowdown,
though I dont have a firm grasp on how much.

By the way, if you are matching lists, you can use the list-match
binding form directly, to eliminate an extra pair of parens:

  (~for/list ([($list a b) some-sequence])

Please keep me updated with any problems you have.

> Konrad.
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.