From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: bug#9567: curious match bug (?) Date: Fri, 23 Sep 2011 18:24:30 +0200 Message-ID: References: <87fwjqin5f.fsf@pobox.com> <87d3ers4fc.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=00151774113a6ac05604ad9e3ea3 X-Trace: dough.gmane.org 1316795085 31422 80.91.229.12 (23 Sep 2011 16:24:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 23 Sep 2011 16:24:45 +0000 (UTC) To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 9567@debbugs.gnu.org, wingo@pobox.com Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Sep 23 18:24:41 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1R78YK-0001nA-QU for guile-bugs@m.gmane.org; Fri, 23 Sep 2011 18:24:41 +0200 Original-Received: from localhost ([::1]:33165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R78YK-0003Wt-AA for guile-bugs@m.gmane.org; Fri, 23 Sep 2011 12:24:40 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:45732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R78YG-0003WY-R2 for bug-guile@gnu.org; Fri, 23 Sep 2011 12:24:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R78YF-0007Fx-Rj for bug-guile@gnu.org; Fri, 23 Sep 2011 12:24:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48596) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R78YF-0007Ft-QB for bug-guile@gnu.org; Fri, 23 Sep 2011 12:24:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1R78Yg-0000hA-GG for bug-guile@gnu.org; Fri, 23 Sep 2011 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Israelsson Tampe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 23 Sep 2011 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9567 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 9567-submit@debbugs.gnu.org id=B9567.13167951012665 (code B ref 9567); Fri, 23 Sep 2011 16:25:02 +0000 Original-Received: (at 9567) by debbugs.gnu.org; 23 Sep 2011 16:25:01 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R78Ye-0000gv-NE for submit@debbugs.gnu.org; Fri, 23 Sep 2011 12:25:00 -0400 Original-Received: from mail-iy0-f172.google.com ([209.85.210.172]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1R78Yc-0000gn-3n for 9567@debbugs.gnu.org; Fri, 23 Sep 2011 12:24:59 -0400 Original-Received: by iaby26 with SMTP id y26so4000540iab.3 for <9567@debbugs.gnu.org>; Fri, 23 Sep 2011 09:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lzbO5Y7QCCEjQsXdk1wCHwr7DPMWP14y8MelOgCXcIY=; b=QrQoMEujYggV5yusrX7muAt+KuZlI7MjFzCJWYC1kP6vZ1/UCT782WEsj/cyiFJBhM 8GFDblZM5gqSxI5CY8rqOVWwTPwMHg5AKEP/TJDcTWT1NtTSpYEotpsMgWxkKV+zZ59V Aiyy1gotteCy18+6h7n8YMb1HCO1oTQs8BLHM= Original-Received: by 10.231.50.204 with SMTP id a12mr5963005ibg.11.1316795070463; Fri, 23 Sep 2011 09:24:30 -0700 (PDT) Original-Received: by 10.231.50.71 with HTTP; Fri, 23 Sep 2011 09:24:30 -0700 (PDT) In-Reply-To: <87d3ers4fc.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 23 Sep 2011 12:25:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5845 Archived-At: --00151774113a6ac05604ad9e3ea3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On the other hand (let ((pat '(a _ ...))) (match '(x y z) (pat #t))) $1 =3D #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=E8s > Could it be a feature? > > (let ((pat '('a _ ...))) > (match '(a b c) (pat #t))) > =3D> #t > > Ludo'. > > > > --00151774113a6ac05604ad9e3ea3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On the other hand

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

as well,

a more canonica= l example of this problem (where I saw it first)
are when using 'an= d' 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 lo= cation 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 con= sider moving this fix upstream.

/Stefan
2011/9/23 Ludovic Court=E8s <ludo@gnu.org>
Could it be a feature?

=A0(let ((pat '('a _ ...)))
=A0 =A0(match '(a b c) (pat #t)))
=A0=3D> #t

Ludo'.




--00151774113a6ac05604ad9e3ea3--