Subject: bug#9567: curious match bug (?)

From: Stefan Israelsson Tampe <[email-masked]>
Date: Fri, 23 Sep 2011 18:24:30 +0200

On the other hand

(let ((pat '(a _ ...)))
   (match '(x y z) (pat #t)))
$1 = #t

as well,

a more canonical example of this problem (where I saw it first)
are when using 'and' e.g.

(define a '(1 2))

(match a ((and (a 2) (1 b)) (+ a b)) (_ #f))
-> #f

But with my fix you wil get the correct 3.

Now the reson are that for 'and' as well as for '$' another location a is
under the command
of an implicit (let ((a car)) ...). One could perhaps argue that this is a
bug in syntax handling but I would not think so. Anyway maybe we should
consider moving this fix upstream.

/Stefan
2011/9/23 Ludovic Courtès <[email-masked]>

> Could it be a feature?
>
>  (let ((pat '('a _ ...)))
>    (match '(a b c) (pat #t)))
>  => #t
>
> Ludo'.
>
>
>
>