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

From: Andrew Reilly (andrew-scheme at areilly.bpc-users.org)
Date: Tue Feb 12 06:49:48 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))
return
(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.]

-- 
Andrew


Posted on the users mailing list.