From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.bugs Subject: bug#68509: 30.0.50; pcase-dolist matches backquote pattern incorrectly Date: Tue, 16 Jan 2024 08:52:27 -0800 Message-ID: <9bc2bd05-5fdb-9d5a-3d98-c344c7275027@gmail.com> References: <87a5p5l3jm.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24055"; mail-complaints-to="usenet@ciao.gmane.io" To: Ihor Radchenko , 68509@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 16 17:53:29 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 1rPmgr-0005zo-Ci for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 16 Jan 2024 17:53:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPmgS-0005Er-5F; Tue, 16 Jan 2024 11:53:04 -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 1rPmgQ-0005EZ-Ve for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 11:53:03 -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 1rPmgP-0007V9-Sb for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 11:53:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPmgQ-0003kS-Bw for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 11:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2024 16:53:02 +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.170542395514371 (code B ref 68509); Tue, 16 Jan 2024 16:53:02 +0000 Original-Received: (at 68509) by debbugs.gnu.org; 16 Jan 2024 16:52:35 +0000 Original-Received: from localhost ([127.0.0.1]:49585 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmfz-0003ji-8N for submit@debbugs.gnu.org; Tue, 16 Jan 2024 11:52:35 -0500 Original-Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]:53372) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPmfw-0003jV-P4 for 68509@debbugs.gnu.org; Tue, 16 Jan 2024 11:52:34 -0500 Original-Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-5cf1f4f6c3dso3084363a12.2 for <68509@debbugs.gnu.org>; Tue, 16 Jan 2024 08:52:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705423946; x=1706028746; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=tdeggJvxVOodRM3G/51HdCQo32MbkdIydgR/x4W5xqM=; b=NhpM49FEPuRovLIh3imNcLsT7y99XgjYoEbWRze9UoxIL+b/HxzKIPPavQEHOHgv5W 6vmvV8XDZSS9Z1tgEu14Uoxqz5oFxZeoGPcFTlXZPYdLc+e7qmgoHDN5rAkOjnqnxqRi SsW5PmUVfhYfe1cDG2LBozXwIyH8qX5JPr4+SQYBkpuUnnfGajZpH9Jw4w8sYoTH0JIM lu98y4JG+lpMi9z7pc552celjcAfNfahcGyDSYQI3eV01sUl/jJTUtS+aSrA7MiBtg3d 7gFBorG03XkPQCHT5e+YhqR9lEFA9e41Jo9H17rq0bX9C1oZ2kOh+ARTalqiNafY0Rf+ K4wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705423946; x=1706028746; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tdeggJvxVOodRM3G/51HdCQo32MbkdIydgR/x4W5xqM=; b=nzEnwD+JP6XqFsptcuRXSA3o9T61OCsTai+PkWAMP6Dy46Sb7mmwkftpAMa1+B6Yuc JCK9OVUft8pLF+ug+Ig3dBC3H9+RYh8+sIobgPdsrUkfi0cNfR+J3uzyo2Ehr7bmVypb 4udBLD2s/zun0HCXgFXZrcKOcfYFcaBM6p3V2uZ/wldd1GL0jwwrDkvAJ3s3lmmHzmDC Zo97J+Occ7Bm9KND1swBrNBFp9S3xMz0DIfuNSwzW99X1+nkqFVdGYFdkExLOhbJj3FK aIZqBnX6CGToSPwlHnPGopbDBQWhNYLtoJUPhF2rbNmAuLkooNUngsw6jbM60w6iHWhw y8jw== X-Gm-Message-State: AOJu0YyoAi6mJ58zUiCx8T42yxryMG6dXuOE9hzd/baw2+hQVNJanxWt KKnh2bMC4lvX7mmD6YT1D1o= X-Google-Smtp-Source: AGHT+IEJrJcOANPQMZVLWS/QwV6Xs29cxh4lPdPjEQUSeuGXJBLFLHb1Z70GCa2+Ev57mx2mMVrS/A== X-Received: by 2002:a05:6a20:da9b:b0:199:d6c7:2e44 with SMTP id iy27-20020a056a20da9b00b00199d6c72e44mr3814749pzb.3.1705423946325; Tue, 16 Jan 2024 08:52:26 -0800 (PST) Original-Received: from [192.168.1.2] (076-168-148-233.res.spectrum.com. [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id fh7-20020a056a00390700b006d9b2d86bcasm9558087pfb.46.2024.01.16.08.52.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Jan 2024 08:52:25 -0800 (PST) Content-Language: en-US In-Reply-To: <87a5p5l3jm.fsf@localhost> 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:278347 Archived-At: On 1/16/2024 7:07 AM, Ihor Radchenko wrote: > 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. 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.