From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marco Antoniotti Newsgroups: gmane.emacs.bugs Subject: bug#70597: Problem in pcase-let? Date: Fri, 26 Apr 2024 20:00:02 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000efe4de061703ac76" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24604"; mail-complaints-to="usenet@ciao.gmane.io" To: 70597@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 26 23:15:19 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 1s0Suc-0006DN-VH for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Apr 2024 23:15:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s0SuG-0000OE-Mt; Fri, 26 Apr 2024 17:14:56 -0400 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 1s0SuE-0000Np-GJ for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 17:14:54 -0400 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 1s0SuE-0007CS-6i for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 17:14:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s0SuV-0000YM-AJ for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 17:15:11 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marco Antoniotti Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Apr 2024 21:15:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70597 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17141660811720 (code B ref -1); Fri, 26 Apr 2024 21:15:08 +0000 Original-Received: (at submit) by debbugs.gnu.org; 26 Apr 2024 21:14:41 +0000 Original-Received: from localhost ([127.0.0.1]:38557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0Su0-0000Rf-5b for submit@debbugs.gnu.org; Fri, 26 Apr 2024 17:14:40 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:33174) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s0PsJ-0006cB-V8 for submit@debbugs.gnu.org; Fri, 26 Apr 2024 14:00:46 -0400 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 1s0Pru-0003ii-HG for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 14:00:19 -0400 Original-Received: from mail-yb1-xb33.google.com ([2607:f8b0:4864:20::b33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s0Prr-0003yp-U0 for bug-gnu-emacs@gnu.org; Fri, 26 Apr 2024 14:00:17 -0400 Original-Received: by mail-yb1-xb33.google.com with SMTP id 3f1490d57ef6-de5acdb3838so969625276.1 for ; Fri, 26 Apr 2024 11:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714154414; x=1714759214; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=bHBir+ZO2Zw+5ixxDx8ueb+qTKEkgWsr3DRwspDl8QE=; b=S7WlAc08Ws3uvWjVYN0Atv1LEzH9X/MoispQ1L5LtWudeQ9yKe2iO952xAR0JZCFHe GP0Ho+9io1zpzwFbc0rOjNUM5iudmjjPBlReyl/897ZxJW0m+nVtNHJ62rzrErlZfn8f bQBkOQYto1SViwh+mKhJrr17v1y9d2tAULwCyQXK4+1Rt2T+hMKjUudDy1VdZCdBFtgL lkKXu2NP+bkqUvjDyo2SKPdHFNjiosbJnDhDONcCfyPJyZIDBvRDtohxhvc70SUXgCtY 59BO4AhdCiB7BJ5QVHQZP6vmMOZKQR9BQkN4wKKqI43GSJQmOPHC/90Utq5ZkjHYsBPz 8s3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714154414; x=1714759214; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bHBir+ZO2Zw+5ixxDx8ueb+qTKEkgWsr3DRwspDl8QE=; b=oqH5CZVeo6vI9zlsmeBi8yv32kHH61btqlmPTKmLP8gQGBuKIX5wO+ijjXsnk5R7ba +v/Wp9cx7PvVsF1QO4NCJvPJRpjH6IvVnej5T+ZIUBMoSM5J/EiQi5Gcm+pgUplf4jP0 yMamltN17ivRp5CQEcCWNxjeLgq1wi2epA4bHx3d3wh9TQ8ArnFK0aAZ8uAwxMCXUInM C3hjEc82YToEqE2t0Iyd5bFt6ADmqIhct71N3H4K2p3v7klm0/l/P+dI3e+4yRxoto3t Khcn6UTj+ss9ZRROT/a8SnnF/aJkWuzb/wbNPaVcOyHxtKVk5OzsezmfbDsi8PWwmIC+ Ka8g== X-Gm-Message-State: AOJu0YzC8fsFkAiGmLHG9B3k/Xwjvqf5guk+GZrBVUINyvbQ2LjWSbG7 4KGJRY8zoLO49GzynT6hhmYIosfexu3sENPQCVa2dqf/TZHchkGVOW/nLstFEI00XyLpWEfn1eo VIO/Hfb74qJSRSlqrhVvsKA9nwWB5RG6w X-Google-Smtp-Source: AGHT+IFOebVImL3vkyzdTzvmqkl7gX7LCDanocPbr3RA3OfDotoGPTw1pKf0AuHRuPI+B3pwvsiqEnGZIJAuiHbY6+A= X-Received: by 2002:a25:b1a2:0:b0:dcf:c7ef:e4e0 with SMTP id h34-20020a25b1a2000000b00dcfc7efe4e0mr3788175ybj.1.1714154414005; Fri, 26 Apr 2024 11:00:14 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::b33; envelope-from=marcoxa@gmail.com; helo=mail-yb1-xb33.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 26 Apr 2024 17:14:38 -0400 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:284009 Archived-At: --000000000000efe4de061703ac76 Content-Type: text/plain; charset="UTF-8" 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 --000000000000efe4de061703ac76 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

This is for GNU Emacs 29.= 2 (build 2, x86_64-w64-mingw32) of 2024-02-01 running on Windows 11.
<= div>
I just noticed the following with pcase-let and = pcase.=C2=A0 I believe this is a problem with pcase-let.=C2=A0 The following is a IELM transcript.= =C2=A0 The second plet-case sh= ould, IMHO, fail.

ELISP> (pcase-let ((`(let ,bs (when ,c . ,r)) '(let= ((foo 42)) (when 1 2 3))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(li= st 'bs bs 'c c 'r r))
(bs
=C2=A0((foo 42))
=C2=A0c 1 r=
=C2=A0(2 3))
ELISP> (pcase-l= et ((`(let ,bs (when ,c . ,r)) '(let ((foo 42)) (zot 1 2 = 3))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(list 'bs bs 'c c 'r= r))
(bs
=C2=A0((foo 42))
=C2=A0c 1 r
=C2=A0(2 3))

ELISP= > (pcase '(let ((foo 42)) (when 1 2 3))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(`(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
--000000000000efe4de061703ac76--