From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#68509: 30.0.50; pcase-dolist matches backquote pattern incorrectly Date: Tue, 16 Jan 2024 18:43:45 +0000 Message-ID: <87sf2xjezi.fsf@localhost> References: <87a5p5l3jm.fsf@localhost> <9bc2bd05-5fdb-9d5a-3d98-c344c7275027@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16713"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68509@debbugs.gnu.org To: Jim Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 16 19:41:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rPoNK-00049z-LP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jan 2024 19:41:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPoN2-0004Vs-A4; Tue, 16 Jan 2024 13:41:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPoMw-0004ST-No for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 13:41:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPoMv-0000jZ-Fx for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 13:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPoMv-0008KE-Ib for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 13:41:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 18:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68509 X-GNU-PR-Package: emacs Original-Received: via spool by 68509-submit@debbugs.gnu.org id=B68509.170543043931957 (code B ref 68509); Tue, 16 Jan 2024 18:41:01 +0000 Original-Received: (at 68509) by debbugs.gnu.org; 16 Jan 2024 18:40:39 +0000 Original-Received: from localhost ([127.0.0.1]:49754 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPoMZ-0008JN-4C for submit@debbugs.gnu.org; Tue, 16 Jan 2024 13:40:39 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:39205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPoMW-0008J2-T2 for 68509@debbugs.gnu.org; Tue, 16 Jan 2024 13:40:38 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 53E8D240101 for <68509@debbugs.gnu.org>; Tue, 16 Jan 2024 19:40:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705430430; bh=+9lWokKlWPa+YiK+QC93xKekPz+nvfuy1BIU4d4ygrU=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=aCjzSkrZA7icpOcSBolEVQLYjSnDsnIqdPS6D2c5CrotUkTnXJ/QLRhPOXx/is0Y5 1gVweGH4zEVRQnafMRBTB6jCrvYvNHt/TTsxsCK/TeolzYFZxy/U96YMn4/CeeZeeT YmAfXGQdWgbwNm8dXDWzMc6qjpuQBnZ0B/tQbU7nyFuGGBjWToXCYRwtRXtUFGTW7j rV65odGwYOkw5n3GJoZ5ycjzS/v3KLy1JbCIVg6Us1P/w12+of9MPCnZXKxt0QojVS l9gH/qihf4F6QXezznbMijlosByQK2Xtit7TFdoSiDPZ4DEOP98OpKb+wlked0GL5l Unxw6Th/bdDgg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TDyW14nmJz6trs; Tue, 16 Jan 2024 19:40:29 +0100 (CET) In-Reply-To: <9bc2bd05-5fdb-9d5a-3d98-c344c7275027@gmail.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278357 Archived-At: Jim Porter writes: > This isn't an issue with 'pcase-dolist', but rather a known/intentional > limitation of 'pcase-let': > > (pcase-let ((`(,(and (pred stringp) a) . > ,(and (pred stringp) b)) > '("TODO"))) > (warn "%S :: %S" a b)) > -> Warning (emacs): "TODO" :: nil > > The 'pcase-let' docstring says this: > >> Each EXP should match (i.e. be of compatible structure) to its >> respective PATTERN; a mismatch may signal an error or may go >> undetected, binding variables to arbitrary values, such as nil. > > I do think we should fix it somehow though. This behavior is extremely > confusing, and as much as I'm a fan of 'pcase', I'm emphatically *not* a > fan of how this part works. Not sure about pcase-let, but pcase-dolist specifically may be simplified not to use pcase-let: (if (pcase--trivial-upat-p (car spec)) `(dolist ,spec ,@body) (let ((tmpvar (gensym "x"))) `(dolist (,tmpvar ,@(cdr spec)) (pcase ,tmpvar (,(car spec) ,@body))))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at