GNU bug report logs -
#68509
30.0.50; pcase-dolist matches backquote pattern incorrectly
Previous Next
Full log
View this message in rfc822 format
Hi,
Consider the following
(pcase-dolist (`(,(and (pred stringp) a) .
,(and (pred stringp) b))
'(("TODO") ("DONE" . "a")))
(warn "%S :: %S" a b))
Executing the above yields
⛔ Warning (emacs): "TODO" :: nil
⛔ Warning (emacs): "DONE" :: "a"
even though ("TODO") does not match the pattern.
In contrast
(dolist (el '(("TODO") ("DONE" . "a")))
(pcase el
(`(,(and (pred stringp) a) .
,(and (pred stringp) b))
(warn "%S :: %S" a b))))
correctly displays
⛔ Warning (emacs): "DONE" :: "a"
In GNU Emacs 30.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version
3.24.39, cairo version 1.18.0) of 2024-01-16 built on localhost
Repository revision: 5f73258753ee91c8648e0be55332f7dbaea9fa8b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101010
System Description: Gentoo Linux
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
This bug report was last modified 1 year and 111 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.