unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>, 9567@debbugs.gnu.org, wingo@pobox.com
Subject: bug#9567: curious match bug (?)
Date: Fri, 23 Sep 2011 18:24:30 +0200	[thread overview]
Message-ID: <CAGua6m18jOqkY8rWajh+L+JyNx=t=vEjRwDaVdmqfsVq+D_5qQ@mail.gmail.com> (raw)
In-Reply-To: <87d3ers4fc.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 776 bytes --]

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 <ludo@gnu.org>

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

[-- Attachment #2: Type: text/html, Size: 1149 bytes --]

  reply	other threads:[~2011-09-23 16:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21  3:34 bug#9567: curious match bug (?) Andy Wingo
2011-09-21 12:15 ` Stefan Israelsson Tampe
2011-09-23 14:45 ` Ludovic Courtès
2011-09-23 16:24   ` Stefan Israelsson Tampe [this message]
2011-09-24 14:51   ` Andy Wingo
2011-09-24 15:01 ` bug#9567: `match' bug ? Andy Wingo
2011-09-25  6:59   ` Alex Shinn
2011-10-15 14:07     ` Ludovic Courtès
2011-10-16  7:28       ` Alex Shinn
2011-10-16 16:38         ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGua6m18jOqkY8rWajh+L+JyNx=t=vEjRwDaVdmqfsVq+D_5qQ@mail.gmail.com' \
    --to=stefan.itampe@gmail.com \
    --cc=9567@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).