[plt-scheme] Not getting a tricky match right: possible?

From: Andrew Reilly (andrew at areilly.bpc-users.org)
Date: Tue Feb 12 05:27:01 EST 2008

Hi there,

Here's a match question, prompted by a recent c.l.l post:

Why doesn't this expression:
(match '(1 1 (f a) 2 3 y (f 8) 9 (f 10))
       ((list (and _ (list 'f x)) ...) x))
(a 8 10)?

(It breaks because there is no matching clause.)

I thought that the (and _ foo) would ensure that at least
something would match (and be discarded).

I started by trying to use (list-no-order (list 'f x) ... _ ...)
but apparently multiple sets of ellipsis aren't allowed here.

Still, I'd like to know if the (list (and _ pat) ...) version is
intended to work but doesn't at the moment, or if I'm just
missing something in the documentation?

[This is with #lang scheme on 3.99.10, or after (require (lib
"plt-match.ss")) on 372.  I tried building trunk on my FreeBSD
system this morning, and it broke during the install, processing
the yacc library, I think.  Anything in particular changed
there?  I haven't had time to investigate properly, yet.]


Posted on the users mailing list.