[plt-scheme] Match bug
I replied to this earlier, but my mailer has a bug and the message was
not posted to the list. I think I lost several postings that way.
Anyway, David van Horn wrote:
> I happen to come across what seems like another bug in match.
>
> (match '((a 1) (b 1))
> (((or ('a _) ('b _)) ..1)
> #t))
>
> ;=> #t Ok.
>
> (match '((a 1) (b 1))
> (((or ('a x) ('b x)) ..1)
> #t))
>
> ;cdr: expects argument of type <pair>; given #f
>
Thanks for finding this. It has been fixed and the fixed version should
be in CVS soon.
> And I was wondering if the grammar for match could be slightly extended.
>
> I believe that (and pat1 ... patn) could be (and lvp1 ... lvpn),
> likewise for `or' and `not'.
>
> This would allow patterns such as
>
> (or ('p x) ...
> ('q x) ...)
Since you are only matching against one object here I am
suprised that you would want to keep matching a pattern to it
continually?
Am I missing something?
Have a good one,
Bruce