Subject: bug#68509: 30.0.50; pcase-dolist matches backquote pattern incorrectly

From: Ihor Radchenko <[email-masked]>
Date: Tue, 16 Jan 2024 15:07:57 +0000

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>