[plt-scheme] About matching ors...
Paulo J. Matos wrote:
> Hi,
>
> When requiring plt-match.ss and trying:
> (define test
> (match-lambda
> [(list (or id
> (list x y z)))
> (printf "~a ~a ~a ~a ~n" id x y z)]
> [_
> (printf "buh~n")]))
>
> I get:
> expand: unbound variable in module in: x
>
> Why x? Why not id?
> This is a curious situation because probably some variables might
> become unbound, right? I couldn't find a place on the manual
> describing in detail this issues but it's wierd.
* (or pat1 ··· patn) -- matches if any of the subpatterns match.
At least one subpattern must be present.
All subpatterns must bind the same set of pattern variables.
It's the last requirement that you pattern violates - but the
error message isn't too clear.
--
Jens Axel Søgaard