GNU bug report logs - #13678
24.2.93; pcase: mention list-like QPatterns in the doc

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Sun, 10 Feb 2013 17:49:02 UTC

Severity: minor

Found in version 24.2.93

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13678 in the body.
You can then email your comments to 13678 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13678; Package emacs. (Sun, 10 Feb 2013 17:49:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to michael_heerdegen <at> web.de:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 10 Feb 2013 17:49:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.2.93; pcase: mention list-like QPatterns in the doc
Date: Sun, 10 Feb 2013 18:49:33 +0100
Hi,

due to the doc of `pcase' (similarly in the manual), this is the list of
forms that is valid as a QPattern:

,----------------------------------------------------------------------
| QPatterns can take the following forms:
|   (QPAT1 . QPAT2)	matches if QPAT1 matches the car and QPAT2 the cdr.
|   ,UPAT			matches if the UPattern UPAT matches.
|   STRING		matches if the object is `equal' to STRING.
|   ATOM			matches if the object is `eq' to ATOM.
`----------------------------------------------------------------------

I think it should also mention list-like patterns (without dot):

    (QPat1 ...QPatn)    matches any n-element list were each
                        element matches the according QPattern

Sure, `(QPAT1 . QPAT2)' also matches lists - but `(QPAT1 . QPAT2)' and
`(QPat1 ...QPatn)' are different forms (expressions) (although those
expressions could match equal values), so IMHO both should be mentioned.


Thanks,

Michael.


In GNU Emacs 24.2.93.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10)
 of 2013-02-09 on drachen
Bzr revision: cyd <at> gnu.org-20130209044342-t2b063zu2fqy8nud
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
System Description:	Debian GNU/Linux 7.0 (wheezy)

Configured using:
 `configure '--prefix=/usr/local/built/''





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13678; Package emacs. (Mon, 11 Feb 2013 01:45:02 GMT) Full text and rfc822 format available.

Message #8 received at 13678 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 13678 <at> debbugs.gnu.org
Subject: Re: bug#13678: 24.2.93; pcase: mention list-like QPatterns in the doc
Date: Sun, 10 Feb 2013 20:43:57 -0500
> Sure, `(QPAT1 . QPAT2)' also matches lists - but `(QPAT1 . QPAT2)' and
> `(QPat1 ...QPatn)' are different forms (expressions)

Actually, no, they are identical:

  (QPAT1 QPAT2 QPAT3) is indistinguishable from
  (QPAT1 . (QPAT2 . (QPAT3 . nil)))

the equivalence between the two is imposed by the reader, long before we
know that these things will be "patterns in a pcase" rather than
expressions, or data in a quoted thingy, ...
  

        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13678; Package emacs. (Mon, 11 Feb 2013 13:37:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#13678: 24.2.93; pcase: mention list-like QPatterns in the doc
Date: Mon, 11 Feb 2013 14:37:48 +0100
Hi Stefan,

> > Sure, `(QPAT1 . QPAT2)' also matches lists - but `(QPAT1 . QPAT2)' and
> > `(QPat1 ...QPatn)' are different forms (expressions)
>
> Actually, no, they are identical:
>
>   (QPAT1 QPAT2 QPAT3) is indistinguishable from
>   (QPAT1 . (QPAT2 . (QPAT3 . nil)))
>
> the equivalence between the two is imposed by the reader, long before we
> know that these things will be "patterns in a pcase" rather than
> expressions, or data in a quoted thingy, ...

Simply right, thanks.  I wonder, however, if that's clear for every
user.  Nonetheless, there are enough examples in

  (elisp) Pattern matching case statement

that use the (QPAT1 QPAT2 QPAT3) syntax.  So, I'll close this, thanks.


Regards,

Michael.




bug closed, send any further explanations to 13678 <at> debbugs.gnu.org and michael_heerdegen <at> web.de Request was from Michael Heerdegen <michael_heerdegen <at> web.de> to control <at> debbugs.gnu.org. (Mon, 11 Feb 2013 14:25:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 12 Mar 2013 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 103 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.