[plt-scheme] Match - naming the result of pat ...

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Feb 6 18:50:38 EST 2006

Ryan Culpepper wrote:

> The '?' form allows you to put more patterns after the predicate, so
> you could write the following to get the all-numeric prefix of the
> list:
> 
> (match '(1 2 3 a 4 5)
>   [((? number? nums) ... . more)
>    nums])

Ah!

Thanks,
Jens Axel Søgaard




Posted on the users mailing list.