GNU bug report logs - #70597
Problem in pcase-let?

Previous Next

Package: emacs;

Reported by: Marco Antoniotti <marcoxa <at> gmail.com>

Date: Fri, 26 Apr 2024 21:15:08 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Marco Antoniotti <marcoxa <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Problem in pcase-let?
Date: Fri, 26 Apr 2024 20:00:02 +0200
[Message part 1 (text/plain, inline)]
Hi

This is for GNU Emacs 29.2 (build 2, x86_64-w64-mingw32) of 2024-02-01
running on Windows 11.

I just noticed the following with pcase-let and pcase.  I believe this is a
problem with pcase-let.  The following is a IELM transcript.  The second
plet-case should, IMHO, fail.

ELISP> (pcase-let ((`(let ,bs (*when *,c . ,r)) '(let ((foo 42)) (*when *1
2 3))))
         (list 'bs bs 'c c 'r r))
(bs
 ((foo 42))
 c 1 r
 (2 3))

ELISP> (pcase-let ((`(let ,bs (*when *,c . ,r)) '(let ((foo 42)) (*zot *1 2
3))))
         (list 'bs bs 'c c 'r r))
(bs
 ((foo 42))
 c 1 r
 (2 3))

ELISP> (pcase '(let ((foo 42)) (*when *1 2 3))
         (`(let ,bs (*zot *,c . ,r)) (list 'bs bs 'c c 'r r)))
nil

pcase correctly fails to match *when *and *zot*, while pcase-let seems to
happily go ahead.

All the best

-- 
Marco Antoniotti
Somewhere over the Rainbow
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 17 days ago.

Previous Next


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