[plt-dev] Match and for

From: Sam TH (samth at ccs.neu.edu)
Date: Wed Jul 29 11:55:50 EDT 2009

On Wed, Jul 29, 2009 at 10:55 AM, Jay McCarthy<jay.mccarthy at gmail.com> wrote:
> I write stuff like this a lot:
> (for ([s (in-list shapes)])
>  (match s
>    [
> I would love to write
> (for ([(struct rect (i x y h w)) (in-list shapes)])
> with some annotation.
> There is an obvious hack macro... but can anyone think of a good way
> that scales with the many for forms and sequence types etc?

I wrote a macro like this a while back.  You can see it at

Matthew seemed initially skeptical, but I wasn't able to find any
immediate problems with the code I wrote.
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.