GNU bug report logs -
#31311
27.0; doc of `pcase'
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Sun, 29 Apr 2018 16:04:02 UTC
Severity: wishlist
Found in version 27.0
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #95 received at 31311 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
() Michael Heerdegen <michael_heerdegen <at> web.de>
() Sat, 12 May 2018 15:54:18 +0200
> a. (pcase t ('t 'true)) => true
> b. (pcase nil ('nil 'false)) => false
> c. (pcase t (t 'true)) => true
> d. (pcase nil (nil 'false)) |= ERROR: Unknown pattern ‘nil’
That's all correct and intended - see 3ef31167. t was
originally intended as catchall pattern equivalent to _ but
has been deprecated (since it was confusing). Try e.g.
(pcase nil
(t t))
You get a message when you use it, but when evaluating and
not when compiling (so you must look in the *Messages* buffer
- I don't think this is intended...). A catch-nothing
pattern is not useful, so nil is just invalid.
Thanks. I've added a blurb suggesting to avoid both ‘t’ and
‘nil’ (commit 5fc0f24c). Here's the text:
Two symbols to avoid are @code{t}, which behaves like @code{_}
(above) and is deprecated, and @code{nil}, which signals error.
It makes no sense to bind these (@pxref{Constant Variables}).
This is in the table, part of the @var{symbol} entry.
--
Thien-Thi Nguyen -----------------------------------------------
(defun responsep (query)
(pcase (context query)
(`(technical ,ml) (correctp ml))
...)) 748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 24 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.