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.

Full log


View this message in rfc822 format

From: Philipp Stephani <p.stephani2 <at> gmail.com>
To: Johan Bockgård <bojohan <at> gnu.org>
Cc: 20636 <at> debbugs.gnu.org
Subject: 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)]

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.