GNU bug report logs - #20636
24.5; pcase: nil should be an UPattern

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Sat, 23 May 2015 18:30:05 UTC

Severity: normal

Tags: wontfix

Found in version 24.5

Done: npostavs <at> users.sourceforge.net

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 20636 in the body.
You can then email your comments to 20636 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#20636; Package emacs. (Sat, 23 May 2015 18:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Philipp Stephani <p.stephani2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 23 May 2015 18:30:07 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; pcase: nil should be an UPattern
Date: Sat, 23 May 2015 20:27:48 +0200
The pcase help says that SELFQUOTING is a UPattern.  This works for
e.g. t, but not for nil.  E.g.,

(pcase nil (nil 1))

raises a `setting-constant' signal.  I think that nil should be
supported as upattern.



In GNU Emacs 24.5.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72)
 of 2015-04-12 on p
Configured using:
 `configure --prefix=/usr/local/Cellar/emacs/24.5
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs/24.5/share/info/emacs
 --with-file-notification=gfile --with-dbus --with-gnutls --with-rsvg
 --with-imagemagick --without-popmail --with-ns
 --disable-ns-self-contained'

Important settings:
  value of $LANG: de_DE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Entering debugger...
Back to top level.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
help-fns mail-prsvr mail-utils help-mode easymenu debug pcase xterm
time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel ns-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment lisp-mode prog-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button
faces cus-face macroexp files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind gfilenotify cocoa ns multi-tty
emacs)

Memory information:
((conses 16 80412 6720)
 (symbols 48 17807 0)
 (miscs 40 34 132)
 (strings 32 10771 4791)
 (string-bytes 1 282032)
 (vectors 16 7394)
 (vector-slots 8 343172 26626)
 (floats 8 63 594)
 (intervals 56 193 6)
 (buffers 960 12))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20636; Package emacs. (Sun, 24 May 2015 00:27:02 GMT) Full text and rfc822 format available.

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

From: Johan Bockgård <bojohan <at> gnu.org>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 20636 <at> debbugs.gnu.org
Subject: Re: bug#20636: 24.5; pcase: nil should be an UPattern
Date: Sun, 24 May 2015 02:25:46 +0200
Philipp Stephani <p.stephani2 <at> gmail.com> writes:

> The pcase help says that SELFQUOTING is a UPattern.  This works for
> e.g. t

Actually, t is not self-matching; it is equivalent to _ (match
anything). But this "feature" seems to be undocumented.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20636; Package emacs. (Sun, 24 May 2015 11:01:03 GMT) Full text and rfc822 format available.

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

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Johan Bockgård <bojohan <at> gnu.org>
Cc: 20636 <at> debbugs.gnu.org
Subject: Re: bug#20636: 24.5; pcase: nil should be an UPattern
Date: Sun, 24 May 2015 11:00:03 +0000
[Message part 1 (text/plain, inline)]
Johan Bockgård <bojohan <at> gnu.org> schrieb am So., 24. Mai 2015 um 02:27 Uhr:

> Philipp Stephani <p.stephani2 <at> gmail.com> writes:
>
> > The pcase help says that SELFQUOTING is a UPattern.  This works for
> > e.g. t
>
> Actually, t is not self-matching; it is equivalent to _ (match
> anything). But this "feature" seems to be undocumented.
>
>
Thanks, I really wasn't aware of that! nil and t should work as QPatterns
(they are atoms), but the documentation about UPatterns seems less clear.
Specifically, 'self-quoting' doesn't seem to be an established or widely
known term.  The Elisp manual talks about 'self-evaluating forms' (anything
that is not a list or symbol), but 'self-quoting' in the `pcase' sense
seems to be a more comprehensive construct as it also includes keywords.
The Elisp manual talks about 'symbols acting like self-evaluating-forms' in
the following paragraph:

   The symbols `nil' and `t' are treated specially, so that the value
of `nil' is always `nil', and the value of `t' is always `t'; you
cannot set or bind them to any other values.  Thus, these two symbols
act like self-evaluating forms, even though `eval' treats them like any
other symbol.  A symbol whose name starts with `:' also self-evaluates
in the same way; likewise, its value ordinarily cannot be changed.

So this definition includes both keywords and nil and t. Ideally,
'self-quoting' in the pcase sense would have the same meaning (right now it
includes keywords but not nil or t). The documentation should really
enumerate all the forms exhaustively to make the definitions clearer.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20636; Package emacs. (Fri, 01 Jul 2016 02:43:02 GMT) Full text and rfc822 format available.

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

From: npostavs <at> users.sourceforge.net
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 20636 <at> debbugs.gnu.org, Johan Bockgård <bojohan <at> gnu.org>
Subject: Re: bug#20636: 24.5; pcase: nil should be an UPattern
Date: Thu, 30 Jun 2016 22:42:37 -0400
tags 20636 wontfix
close 20636
quit

In 20784 it was decided to that nil and t should not be valid patterns
at all (t is still supported as a match-all, but deprecated).




Added tag(s) wontfix. Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 01 Jul 2016 02:43:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 20636 <at> debbugs.gnu.org and Philipp Stephani <p.stephani2 <at> gmail.com> Request was from npostavs <at> users.sourceforge.net to control <at> debbugs.gnu.org. (Fri, 01 Jul 2016 02:43: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. (Fri, 29 Jul 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 330 days ago.

Previous Next


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