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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Marco Antoniotti <marcoxa@HIDDEN>; Done: Eli Zaretskii <eliz@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 70597-done <at> debbugs.gnu.org:


Received: (at 70597-done) by debbugs.gnu.org; 4 May 2024 11:36:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 04 07:36:25 2024
Received: from localhost ([127.0.0.1]:52859 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s3Dgl-0004Ka-5z
	for submit <at> debbugs.gnu.org; Sat, 04 May 2024 07:36:25 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s3Dgg-0004KP-Rf
 for 70597-done <at> debbugs.gnu.org; Sat, 04 May 2024 07:36:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s3DgB-00063U-Lh; Sat, 04 May 2024 07:35:48 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=WkMlILNgnj5zFJNd5xiMMokzKCqAUU91w/B/ui3Lc0E=; b=GkuuluC8H3bK
 j/F3NQIQqLQUMLll+rftT0XNL0TiZwReyn6NL8fECWygOupAVfKe4QLIqSFXhBIWFOvBGPQQbF7wj
 24SGLNcF1MR4pf2qtN2604S2AjEv/RIiTXrt9PvNcr73Rx9qQg3e3xfMYm8SjZkzWw/2B8FMtrSRl
 +UfuLP9RS8WmnehSZvMRVJuUBz9X3jaO8Yi+Xl/e4JpHPHRMYSQTRHe9W/0b5FtxUSRzCm8ciTsS/
 3jk/ocQBs7eUUe5B5aMOq/sfuBC1yl8ChHFVXlupyxwjMxNLTYNBH2GjbxDrBultdBQ4UWIT0Z5KT
 kKaVpokk68DDZqWTJ/D+vQ==;
Date: Sat, 04 May 2024 14:35:43 +0300
Message-Id: <861q6hhks0.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>
In-Reply-To: <CAKmY7cU0NeQEincr8LvcJctg1+YM5tMcPPPUoUK--QJzhaSWuw@HIDDEN>
 (message from Marco Antoniotti on Thu, 2 May 2024 13:06:58 +0200)
Subject: Re: bug#70597: Problem in pcase-let?
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
 <jwv5xw1gpww.fsf-monnier+emacs@HIDDEN> <865xvwmus2.fsf@HIDDEN>
 <CAKmY7cU0NeQEincr8LvcJctg1+YM5tMcPPPUoUK--QJzhaSWuw@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597-done
Cc: brubar.cs@HIDDEN, monnier@HIDDEN, 70597-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Marco Antoniotti <marcoxa@HIDDEN>
> Date: Thu, 2 May 2024 13:06:58 +0200
> Cc: Stefan Monnier <monnier@HIDDEN>, brubar.cs@HIDDEN, 70597 <at> debbugs.gnu.org
> 
> it's your call.  But please change the doc string to clarify that pcase-let does not do "symbol equality" pattern
> matching, but only structural matching.  Adding an example like the following will help.
> 
> (pcase-let ((`(foo ,x 23 ,y) '(bar 11 baz 22))) (list x y))

This is already explained in the ELisp manual, and the doc string
already says

  Each EXP should match its respective PATTERN (i.e. be of structure
  compatible to PATTERN)

So I don't think we need to do anything else here, and I'm closing
this bug.




Notification sent to Marco Antoniotti <marcoxa@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Eli Zaretskii <eliz@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 2 May 2024 11:07:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 02 07:07:39 2024
Received: from localhost ([127.0.0.1]:43114 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s2UHq-00075L-Oj
	for submit <at> debbugs.gnu.org; Thu, 02 May 2024 07:07:39 -0400
Received: from mail-yb1-xb36.google.com ([2607:f8b0:4864:20::b36]:61589)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marcoxa@HIDDEN>) id 1s2UHp-000759-A5
 for 70597 <at> debbugs.gnu.org; Thu, 02 May 2024 07:07:37 -0400
Received: by mail-yb1-xb36.google.com with SMTP id
 3f1490d57ef6-de610800da0so3311339276.2
 for <70597 <at> debbugs.gnu.org>; Thu, 02 May 2024 04:07:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714648030; x=1715252830; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=q7Z0QhMFLE8t+MY0QgkujX3GZRw4SKmyn0R0WWQb6yw=;
 b=Ofh6N2jpLXA+dGNMGdV5qXBf4oim82qhUkyljnncDgtCHCJVeg4MuOjPFnonRFiLpB
 6s/CuVGqZNWmvwru3R3MMKdk/AbdyoNTeF6bW5oQ1JrqPX2DzmtuGvtD0PJqAlkzBumH
 LgLmUMyPbrr4zIzIs9lFCO+7VzNKQIZyFzLAINID1tQeTF+2IznQmvWUqW2pHm+DOFey
 zWdb3SJS1NM3vvxmUL8pACfmFrCAH6IdDeUzKqEgURieksHyuhacnTB09HW4ke/xn6n6
 NnZjOOizhinhqz6kYrdJcdVzKcNc7OGCYPfvogzQRfWXjKZhqigBLMqbvyfgsKiacnH6
 cWNg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714648030; x=1715252830;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=q7Z0QhMFLE8t+MY0QgkujX3GZRw4SKmyn0R0WWQb6yw=;
 b=Pslx70hlWXN2mMp1gIPDIuCYdaKQfgl7UAhr+UDqlTxAzWnpokVGxBKertqNGIfRW5
 qIfZlAdU3q26yxfDHMvKTVGGS41AlSqoXxOtDBNhkpR1ILJknw5RSReJqBL3a3wRVD6P
 St6J81nti4s4vLgW1mbIIWI4mDSI6cU9b5NjD51sol4dMGsrYcrS9jzo611QuVTVlS8P
 vFJNjxpc8ju1eiAVk9bXoUKTahyoZZN/FeKzDMrxQGK+K5FkjG11dx1XD/Dv5sy/XV6d
 zscQOIAdWxEEXhNoeS5/8gzmGfc64o92uTxiiztyjoVJoc8H9ei7LVzOca34efzwki2w
 dHtw==
X-Forwarded-Encrypted: i=1;
 AJvYcCV0dZGN1LyUsz7GH4uusFc9xxFIom1jwt1DQ5XmEdG81wd+A+1vTO4J/uT0p6Bnmw0pc6exP0ymiT1kvQcMi9q6vqjxUSs=
X-Gm-Message-State: AOJu0YyZOTvuq60LhCpbO0aOr4QqS4dfJgV060MtBH9BOoNMTrakheug
 iPtn8/ZPXSRSjRqMAi9cCUUkAMBnQzaxzJJcP8B3oqi3NYpXQ3FulSM9fbDUjaX5zTd+r6zhp2G
 2eOhSC/SE/5lMhc2heYXfzNqvwE4=
X-Google-Smtp-Source: AGHT+IHYf4+NK+xupQmM8azY18OHaLW+E3r3JaYsOrrwuGpCXfQqX3i9Y73p08Cp8Ugjpc5uPLxnL11NLkS6kWB36h0=
X-Received: by 2002:a25:ae4c:0:b0:de4:5f9a:157a with SMTP id
 g12-20020a25ae4c000000b00de45f9a157amr1807441ybe.36.1714648029688; Thu, 02
 May 2024 04:07:09 -0700 (PDT)
MIME-Version: 1.0
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
 <jwv5xw1gpww.fsf-monnier+emacs@HIDDEN> <865xvwmus2.fsf@HIDDEN>
In-Reply-To: <865xvwmus2.fsf@HIDDEN>
From: Marco Antoniotti <marcoxa@HIDDEN>
Date: Thu, 2 May 2024 13:06:58 +0200
Message-ID: <CAKmY7cU0NeQEincr8LvcJctg1+YM5tMcPPPUoUK--QJzhaSWuw@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000b9823c0617769ac0"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
Cc: brubar.cs@HIDDEN, Stefan Monnier <monnier@HIDDEN>,
 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000b9823c0617769ac0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi guys,

it's your call.  But please change the doc string to clarify that pcase-let
does not do "symbol equality" pattern matching, but only structural
matching.  Adding an example like the following will help.

(pcase-let ((`(foo ,x 23 ,y) '(bar 11 baz 22))) (list x y))

All the best

Marco

On Thu, May 2, 2024 at 11:24=E2=80=AFAM Eli Zaretskii <eliz@HIDDEN> wrote:

> > Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
> > Date: Sun, 28 Apr 2024 17:08:21 -0400
> > From:  Stefan Monnier via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >
> > > In any case, at a minimum the warning should be issued.
> >
> > I haven't looked at the code for it, so I don't know how easy it is to
> > implement, but let' hope there's an "easy" way to do it.
> >
> > > I did refrain from using pcase-let after all, although it "seemed
> > > right" for my use case.  Having said that, I would advocate changing
> > > the semantics.
> >
> > The places that already use it largely rely on the current semantics,
> > so changing it would introduce a lot of breakage.
> > It's not really an option.
>
> So I guess we should close this as wontfix?
>


--=20
Marco Antoniotti
Somewhere over the Rainbow

--000000000000b9823c0617769ac0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi guys,</div><div><br></div><div>it&#39;s your call.=
=C2=A0 But please change the doc string to clarify that <span style=3D"font=
-family:monospace">pcase-let</span> does not do &quot;symbol equality&quot;=
 pattern matching, but only structural matching.=C2=A0 Adding an example li=
ke the following will help.<br><br><div style=3D"margin-left:40px"><span st=
yle=3D"font-family:monospace">(pcase-let ((`(foo ,x 23 ,y) &#39;(bar 11 baz=
 22))) (list x y))</span></div></div><div><br></div><div>All the best</div>=
<div><br></div><div>Marco<br></div></div><br><div class=3D"gmail_quote"><di=
v dir=3D"ltr" class=3D"gmail_attr">On Thu, May 2, 2024 at 11:24=E2=80=AFAM =
Eli Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrot=
e:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; Cc: Brun=
o Barbier &lt;<a href=3D"mailto:brubar.cs@HIDDEN" target=3D"_blank">brub=
ar.cs@HIDDEN</a>&gt;, <a href=3D"mailto:70597 <at> debbugs.gnu.org" target=3D=
"_blank">70597 <at> debbugs.gnu.org</a><br>
&gt; Date: Sun, 28 Apr 2024 17:08:21 -0400<br>
&gt; From:=C2=A0 Stefan Monnier via &quot;Bug reports for GNU Emacs,<br>
&gt;=C2=A0 the Swiss army knife of text editors&quot; &lt;<a href=3D"mailto=
:bug-gnu-emacs@HIDDEN" target=3D"_blank">bug-gnu-emacs@HIDDEN</a>&gt;<br>
&gt; <br>
&gt; &gt; In any case, at a minimum the warning should be issued.<br>
&gt; <br>
&gt; I haven&#39;t looked at the code for it, so I don&#39;t know how easy =
it is to<br>
&gt; implement, but let&#39; hope there&#39;s an &quot;easy&quot; way to do=
 it.<br>
&gt; <br>
&gt; &gt; I did refrain from using pcase-let after all, although it &quot;s=
eemed<br>
&gt; &gt; right&quot; for my use case.=C2=A0 Having said that, I would advo=
cate changing<br>
&gt; &gt; the semantics.<br>
&gt; <br>
&gt; The places that already use it largely rely on the current semantics,<=
br>
&gt; so changing it would introduce a lot of breakage.<br>
&gt; It&#39;s not really an option.<br>
<br>
So I guess we should close this as wontfix?<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Marco Antonio=
tti<br>Somewhere over the Rainbow</div>

--000000000000b9823c0617769ac0--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 2 May 2024 09:24:31 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 02 05:24:31 2024
Received: from localhost ([127.0.0.1]:42614 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s2Sg2-0005xK-NR
	for submit <at> debbugs.gnu.org; Thu, 02 May 2024 05:24:30 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:43768)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s2Sg0-0005xB-Rq
 for 70597 <at> debbugs.gnu.org; Thu, 02 May 2024 05:24:29 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s2SfX-000460-Q6; Thu, 02 May 2024 05:23:59 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=7abEfXmOpXIeJgcTdRRZHY7ADwVHD39LWnKbowplVl0=; b=a2d4ktTB7ccg
 GSFCXYZp9I1DRdxBMfGwRWgSAHueQ0rWHCspQ0rnKuV1qk20JtJ27vsYiCwCEXAwf0cgPPpkkDgw0
 HrZigqh5F239292ARoYij8+q+YaCQMlqhm52fPRSwxMI842kBj/pbu8hUnL0O0c2xBUp/nRqOon/P
 vxmg1DkKra60pe1tyqHCp5nWuLjAnL7HbgUi2v6k0rCOIW+aiMrut1nXoBzSs5kCGH4nkznajN+xL
 V42Qo5XKaMvvsvYzB3fVrRHO+h0LbZUW2ANjpwV/87/Mgi6epffloPY7CCvqU3Ub41lnGkbc1yYoG
 DMAYu7QU14pid7sbd7Dvow==;
Date: Thu, 02 May 2024 12:23:57 +0300
Message-Id: <865xvwmus2.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <jwv5xw1gpww.fsf-monnier+emacs@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#70597: Problem in pcase-let?
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
 <jwv5xw1gpww.fsf-monnier+emacs@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: brubar.cs@HIDDEN, marcoxa@HIDDEN, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
> Date: Sun, 28 Apr 2024 17:08:21 -0400
> From:  Stefan Monnier via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> > In any case, at a minimum the warning should be issued.
> 
> I haven't looked at the code for it, so I don't know how easy it is to
> implement, but let' hope there's an "easy" way to do it.
> 
> > I did refrain from using pcase-let after all, although it "seemed
> > right" for my use case.  Having said that, I would advocate changing
> > the semantics.
> 
> The places that already use it largely rely on the current semantics,
> so changing it would introduce a lot of breakage.
> It's not really an option.

So I guess we should close this as wontfix?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 21:08:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 17:08:57 2024
Received: from localhost ([127.0.0.1]:52885 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1BlZ-00027a-2Y
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 17:08:57 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:57398)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1s1BlX-00027U-E6
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 17:08:56 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B5F34442206;
 Sun, 28 Apr 2024 17:08:29 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1714338508;
 bh=Lz7++8UD7fUjExjnloNPxWbyGoe1AGBllmMDpmbohYg=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=fSVVW8VYh6czFLVxduufEATmNgJoezDNaj2LCELo3pOBZ3QEsSrK9O4ZPWUipDBj0
 u8KwIay0EMDa6QA737q8Bs2u3VtemdHstbNRRX//6qQHY+W5XhLmBMtj5tLi5abTZx
 ycEtMs5SXfZKATLNO7iJ52pU0hT5wkGJkkK8CmYGCqA/nGpWPv2D5ogpWMCN4XTzIQ
 XBT+YiDAh3P/5Eud2xCmAGPi4r8bjTLB+vLINbjPfpkm+dvtKAUKUo+ladXuqC2EH5
 qFQHmhXmtNLW38cs5N2rNiypFVgNq9d2mFKONI02bwa2mEH4ZLrRVOKPH1KNpLcwPf
 M9m8XRmBMBwTg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 90E48442204;
 Sun, 28 Apr 2024 17:08:28 -0400 (EDT)
Received: from pastel (unknown [45.72.201.215])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 66CCA120306;
 Sun, 28 Apr 2024 17:08:28 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
 (Marco Antoniotti's message of "Sun, 28 Apr 2024 20:22:27 +0200")
Message-ID: <jwv5xw1gpww.fsf-monnier+emacs@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
Date: Sun, 28 Apr 2024 17:08:21 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.007 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> In any case, at a minimum the warning should be issued.

I haven't looked at the code for it, so I don't know how easy it is to
implement, but let' hope there's an "easy" way to do it.

> I did refrain from using pcase-let after all, although it "seemed
> right" for my use case.  Having said that, I would advocate changing
> the semantics.

The places that already use it largely rely on the current semantics,
so changing it would introduce a lot of breakage.
It's not really an option.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 18:23:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 14:23:06 2024
Received: from localhost ([127.0.0.1]:51590 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s19B4-0005DO-BT
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 14:23:06 -0400
Received: from mail-yw1-x1129.google.com ([2607:f8b0:4864:20::1129]:59402)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marcoxa@HIDDEN>) id 1s19B2-0005Cz-1z
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 14:23:04 -0400
Received: by mail-yw1-x1129.google.com with SMTP id
 00721157ae682-61b6200fcb5so39328397b3.2
 for <70597 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 11:22:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714328559; x=1714933359; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=S/++dPZ6Yga5M9GM5mXpG3kmgqzX7y2irj/qxy93cFQ=;
 b=bBcd/z7nxAFMefL3w1WSPzWjBT1Ek0cVXlDMIeMDht62RjQD6/vTbWYl0B7HImqP+8
 zmw3nqzW4kxAS5uuHgs2Ci1D6pSYHVPGBjpXd9e1twCPdUb7Mr706J4p59Wl5CALVgZX
 yK6iISzi+EoPjjRnT7nODrjLcO/u1kj76VvqlYELXXq+7gMCL+56o1LuCefb2GN4PdwG
 YApCRM7UbMCJSoiGf4eZ61oOgOGuM9bl+dDV48UuDZj2MKZr5wTChfKDMlC82AC1W2z4
 9RUpqedlZLbsVZ0fyvyTSpcWFPg8bYsfDzzY7MGleR3gkuWStOKQFwM/YLoFTWm7zJSt
 3R9w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714328559; x=1714933359;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=S/++dPZ6Yga5M9GM5mXpG3kmgqzX7y2irj/qxy93cFQ=;
 b=n4In1mfZ+vCAV4QEV9WxenyBY6tXeCldFPEzO30JgW7gxJoZ+VGbrLsaiFgPWL2CUo
 Y9XQaT9UVHLmL1j09J18/gbBvn3zuPMru5HdGr3T8YlBjGnRK28lqg7ya8WAXuhIbjxk
 JdpRCm47vmaHX6oQskWKPIMAfTjxxhD5QvgE2CZyuiKpPg4ODjF6kIm5NaTqp8KKfSVH
 x3sdlULU6XyXwRp9+1Oa7zdE+FpnqbC45F4mm/RA3orKbnPJ6HjgQOWmeQLb+L+yZM5s
 Md5/koVVyXg3RMvhJsoSMtGViUXtjOP7+jpWuaTTaLYCOxNQWDzXoAfNT68C5zX8zQCi
 cgsg==
X-Forwarded-Encrypted: i=1;
 AJvYcCXrAhw4HgOIGsqU1DY99bA13tcgZpjwKd9ejQeZuij+QTPrgqaJfLP8asHhS4T4VkoM9SYMkcHncl2qshUyxHCKWlDgoGw=
X-Gm-Message-State: AOJu0Yw8PGhIgB2BB49+Ipl2BaZkm04h61BzliBdkncqvgZZWKnVNOJG
 qTI7nZ/mzepn/vtquB/BSTFEvpqB9M9Hi9mp9b85IzfYlv77qXnp9FJszwoh0mWj6eJj0n0MMRU
 AP4XieRgyYBh0VPePg4VKmQjegO45rmEl
X-Google-Smtp-Source: AGHT+IHYgAAOEHDSSNYKxbQGkU9HNO2GNasw9zOJfJypmDnAj+I6MFV/+5g1l8NH/oLe0QOgvrivrgGG/LU3JDT/TrU=
X-Received: by 2002:a05:690c:f88:b0:61a:d455:3dc6 with SMTP id
 df8-20020a05690c0f8800b0061ad4553dc6mr10610521ywb.11.1714328558747; Sun, 28
 Apr 2024 11:22:38 -0700 (PDT)
MIME-Version: 1.0
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
From: Marco Antoniotti <marcoxa@HIDDEN>
Date: Sun, 28 Apr 2024 20:22:27 +0200
Message-ID: <CAKmY7cWKF_jACMOvUZqfL2QnZYhExhg4f29V7BywQRmGsF96MA@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000c5c85006172c38a7"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000c5c85006172c38a7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi

oooops sorry.  Somehow I was missing cl-destructuring-bind; my bad.

In any case, at a minimum the warning should be issued.  I did refrain from
using pcase-let after all, although it "seemed right" for my use case.
Having said that, I would advocate changing the semantics.

Your call anyway.

All the best

On Sun, Apr 28, 2024 at 7:05=E2=80=AFPM Stefan Monnier <monnier@HIDDEN=
al.ca>
wrote:

> > Let me just answer the destructuring-bind comment by Stefan (I am
> answering
> > to his last email).  The previous ones are somewhat answered here as
> well.
> >
> > In some sense, yes.  I kind of want destructuring-bind.  It is, IMHO,
> > unfortunate that ELisp does not have it and that we don't have
> > cl-destructuring-bind either; lower level beast than matching, but
> useful.
>
> I don't understand what you mean: `pcase-let` *is* a destructring bind,
> and we also do have `cl-destructuring-bind`.
>
> > As per the pcase-let, I still think that the name and/or its behavior
> > are confusing because of expectations about how a pattern matcher
> > usually works.
>
> Yes, clearly there is a problem of users being surprised.
>
> But AFAICT, changing the semantics is not the right answer, because the
> current behavior matches(!) what is usually needed and because the other
> behaviors are already well-served by `pcase` and `pcase-exhaustive`.
>
> Maybe a better answer is to try and detect ill-conceived patterns like in=
:
>
>     (pcase-let (`(foo bar ,x) (SOMETHING)) (ANYTHING))
>
> and emit a warning suggesting to rewrite it to
>
>     (pcase-let (`(,_ ,_ ,x) (SOMETHING)) (ANYTHING))
>
>
> - Stefan
>
>

--=20
Marco Antoniotti
Somewhere over the Rainbow

--000000000000c5c85006172c38a7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi</div><div><br></div><div>oooops sorry.=C2=A0 Someh=
ow I was missing <span style=3D"font-family:monospace">cl-destructuring-bin=
d</span>; my bad.<br></div><div><br></div><div>In any case, at a minimum th=
e warning should be issued.=C2=A0 I did refrain from using <span style=3D"f=
ont-family:monospace">pcase-let </span>after all, although it &quot;seemed =
right&quot; for my use case.=C2=A0 Having said that, I would advocate chang=
ing the semantics.<br><br></div><div>Your call anyway.<br></div><div><br></=
div><div>All the best<br></div></div><br><div class=3D"gmail_quote"><div di=
r=3D"ltr" class=3D"gmail_attr">On Sun, Apr 28, 2024 at 7:05=E2=80=AFPM Stef=
an Monnier &lt;<a href=3D"mailto:monnier@HIDDEN">monnier@HIDDEN=
treal.ca</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">&gt; Let me just answer the destructuring-bind comment by Stefan (I=
 am answering<br>
&gt; to his last email).=C2=A0 The previous ones are somewhat answered here=
 as well.<br>
&gt;<br>
&gt; In some sense, yes.=C2=A0 I kind of want destructuring-bind.=C2=A0 It =
is, IMHO,<br>
&gt; unfortunate that ELisp does not have it and that we don&#39;t have<br>
&gt; cl-destructuring-bind either; lower level beast than matching, but use=
ful.<br>
<br>
I don&#39;t understand what you mean: `pcase-let` *is* a destructring bind,=
<br>
and we also do have `cl-destructuring-bind`.<br>
<br>
&gt; As per the pcase-let, I still think that the name and/or its behavior<=
br>
&gt; are confusing because of expectations about how a pattern matcher<br>
&gt; usually works.<br>
<br>
Yes, clearly there is a problem of users being surprised.<br>
<br>
But AFAICT, changing the semantics is not the right answer, because the<br>
current behavior matches(!) what is usually needed and because the other<br=
>
behaviors are already well-served by `pcase` and `pcase-exhaustive`.<br>
<br>
Maybe a better answer is to try and detect ill-conceived patterns like in:<=
br>
<br>
=C2=A0 =C2=A0 (pcase-let (`(foo bar ,x) (SOMETHING)) (ANYTHING))<br>
<br>
and emit a warning suggesting to rewrite it to<br>
<br>
=C2=A0 =C2=A0 (pcase-let (`(,_ ,_ ,x) (SOMETHING)) (ANYTHING))<br>
<br>
<br>
- Stefan<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Marco Antonio=
tti<br>Somewhere over the Rainbow</div>

--000000000000c5c85006172c38a7--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 17:05:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 13:05:56 2024
Received: from localhost ([127.0.0.1]:51255 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s17yO-0001Pl-Da
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 13:05:56 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10175)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1s17yM-0001Pb-09
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 13:05:55 -0400
Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 7434480CE1;
 Sun, 28 Apr 2024 13:05:28 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1714323927;
 bh=LM/KOP/NBuhBsPEXEu4uhPddjbxfSvamc7yMgPvQjxA=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=YoCp/d166KZKblqWjIKSzrUjTzB9ufDLnMsEHCrqwEdqgHFy4aYPJ6t/ILTPzwQGE
 ErvJd58WHuH59W2zHzypdywDINiBruAg4T8Eej6KD7IW2Mdq/zSdguVs/lyM/M53Vo
 KNEoLRIOwBNYSsYmz3YmjCUug/7cO0Oc4tj03mstGq8MqQGxrnzrFKyZth09HweKOC
 UHJ+Xd/LHjRvxxYRBN/6jDK/O93eRX/uYQ/Wf7Sdps7FqzfbenlNzKWJWYoWcgo9vH
 Mkh+vvLxzsBEApG52azRzX0FCKObh+pduSvb6XDvFQ1CHD4Mz6CAj4tAJ/jkPgegCi
 3X5LgTT9L9xpQ==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 66E99806AA;
 Sun, 28 Apr 2024 13:05:27 -0400 (EDT)
Received: from pastel (unknown [45.72.201.215])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3E9CA12030C;
 Sun, 28 Apr 2024 13:05:26 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
 (Marco Antoniotti's message of "Sun, 28 Apr 2024 17:38:30 +0200")
Message-ID: <jwvzftdh1by.fsf-monnier+emacs@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
 <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
Date: Sun, 28 Apr 2024 13:05:26 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.052 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Let me just answer the destructuring-bind comment by Stefan (I am answering
> to his last email).  The previous ones are somewhat answered here as well.
>
> In some sense, yes.  I kind of want destructuring-bind.  It is, IMHO,
> unfortunate that ELisp does not have it and that we don't have
> cl-destructuring-bind either; lower level beast than matching, but useful.

I don't understand what you mean: `pcase-let` *is* a destructring bind,
and we also do have `cl-destructuring-bind`.

> As per the pcase-let, I still think that the name and/or its behavior
> are confusing because of expectations about how a pattern matcher
> usually works.

Yes, clearly there is a problem of users being surprised.

But AFAICT, changing the semantics is not the right answer, because the
current behavior matches(!) what is usually needed and because the other
behaviors are already well-served by `pcase` and `pcase-exhaustive`.

Maybe a better answer is to try and detect ill-conceived patterns like in:

    (pcase-let (`(foo bar ,x) (SOMETHING)) (ANYTHING))

and emit a warning suggesting to rewrite it to

    (pcase-let (`(,_ ,_ ,x) (SOMETHING)) (ANYTHING))


- Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 15:39:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 11:39:08 2024
Received: from localhost ([127.0.0.1]:50847 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s16cO-0000I2-Ch
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:39:08 -0400
Received: from mail-yb1-xb34.google.com ([2607:f8b0:4864:20::b34]:47309)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marcoxa@HIDDEN>) id 1s16cN-0000Hh-35
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:39:07 -0400
Received: by mail-yb1-xb34.google.com with SMTP id
 3f1490d57ef6-de54cb87998so3974335276.2
 for <70597 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 08:38:47 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714318722; x=1714923522; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=QmaceAQF+6IWu/G3Y8gcQ+5+FRvW7pBcPeip8dY3SBg=;
 b=ZESKCWFVsZ+8lGs26cZp8unzJjs2tbwBFTG4A0kc2+1CCa8SWvaIr8WAj6YY5J0Hvx
 ltHLk6yYT3ouiafG+Ss7pIMYLMcorvQA3t+lQY3LbxBK+b+DAf0o4sggDRII6FKoBqLn
 VC+2JsmKqSkzcP3sdUvKf3H4CE4G1aeCOnAauaii89T5aCnVOqLKB6AKezCI1ipoRQ7O
 bYP9REdpF+AdtZvdGazJes1PTL3SeiFEaCEeKWERPy9jO5CIa7+glR6Ggb5L5WmjlEij
 aH87KTwU8W9JmRkya3wcW7Mpxbsnha+pZqnENfYlTUnn9U3oXhuknUcACP+9O+n/guMh
 nR4w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714318722; x=1714923522;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=QmaceAQF+6IWu/G3Y8gcQ+5+FRvW7pBcPeip8dY3SBg=;
 b=hgMWI+1wuDUPBTyWVUfZtKYJ6kYLcVtj7EI4FAVuIUQoEpmTz/TY6t/L1vZXhELIwB
 eQJMMdr33ee3TEnkaB0eLuTQCa9zRHnMOiM/IZWjkR4rTgTbyaVRUf2mtQD42U8kBn+2
 lhJ2KIGJUxRvSGz47M3rQAyCHEm4ZeZTQxElyjoFd2ouTj+oBnfzD1l58h5X6x3YMiJX
 9+MXpNgJ8iGtxTu9+42ryb5+/BpKoH2WJ3blBV97GavzfRsardAQUnahKRIAJmDzGsVd
 FYFUxAigq2WASzY8z8U3E0Ua263HMppVMQRcjvN8cLhqQgF1d9BDFklecUghHl7NSek1
 K/7w==
X-Forwarded-Encrypted: i=1;
 AJvYcCU9RslgXMPs2sKkzpsucrraGbbmvkACqnmnt0DiO01bJesklA414Jor1MBJ249nf8FDaeD0pIpRXOrmMGiemk8/snivzEQ=
X-Gm-Message-State: AOJu0YzjPg/6zcCplg2hZByJe8201ZA0UY5rbUxILXWuf6HRWRgz6cN3
 82Xn8dLCXLJuHraovABwnaruzeJ71BO4a5Fdf21NQ0puRvAKb0pFBEe7t19LouEFPkyhi5Iv5P6
 qtEq97CGsQLufK5hPI2kokIF6vaA=
X-Google-Smtp-Source: AGHT+IFDCheado547Q/0h7p7Hi65WSQUb2Ec8Xnx7tTrrkP8q9m612GE+QRZHdkLW95aJVndspX8Wus8c2+5YWiNynk=
X-Received: by 2002:a25:7447:0:b0:dd1:3421:b3ea with SMTP id
 p68-20020a257447000000b00dd13421b3eamr9091780ybc.21.1714318721811; Sun, 28
 Apr 2024 08:38:41 -0700 (PDT)
MIME-Version: 1.0
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
In-Reply-To: <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
From: Marco Antoniotti <marcoxa@HIDDEN>
Date: Sun, 28 Apr 2024 17:38:30 +0200
Message-ID: <CAKmY7cVY8m8dKU-rJZx+Mz8=WDEBSHAZKGqbUeg3-n-NRY2s9Q@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000720ee9061729ee1b"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000720ee9061729ee1b
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Thank you all for the replies.

Let me just answer the destructuring-bind comment by Stefan (I am answering
to his last email).  The previous ones are somewhat answered here as well.

In some sense, yes.  I kind of want destructuring-bind.  It is, IMHO,
unfortunate that ELisp does not have it and that we don't have
cl-destructuring-bind either; lower level beast than matching, but useful.

As per the pcase-let, I still think that the name and/or its behavior are
confusing because of expectations about how a pattern matcher usually
works.  Of course you have the problems with "no matching" but that
semantics can be dealt with separately, without surprising the user (at
least me).  And note that this is, IMHO, "surprising".

*(pcase-let (`(foo bar ,x) '(bar foo 42)) x)*

IMHO, this should either return nil or signal an error.  With
destructuring-bind* I would write (assuming indifference variables):

*(destructuring-bind* (_ _ x) x)*

All the best

Marco


On Sun, Apr 28, 2024 at 5:22=E2=80=AFPM Stefan Monnier <monnier@HIDDEN=
al.ca>
wrote:

> > Pattern matchers do ... pattern matching.
>
> `pcase` is a pattern matcher.
> `pcase-let` is not: it performs "destructuring bindings".
>
> If you want to test if a pattern matches, then you want to use `pcase`
> or `pcase-exhaustive`, and not `pcase-let`.
>
> If you want a "one-branch `pcase-exhaustive` with a let-style notation",
> we could add such a thing of course, but I'd first like to see some
> evidence that it's useful in practice.
>
>
>         Stefan
>
>

--=20
Marco Antoniotti
Somewhere over the Rainbow

--000000000000720ee9061729ee1b
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div><div><div>Thank you all for the replies.<br><br></div=
>Let me just answer the <span style=3D"font-family:monospace">destructuring=
-bind </span>comment by Stefan (I am answering to his last email).=C2=A0 Th=
e previous ones are somewhat answered here as well.<br><br></div>In some se=
nse, yes.=C2=A0 I kind of want <span style=3D"font-family:monospace">destru=
cturing-bind</span>.=C2=A0 It is, IMHO, unfortunate that ELisp does not hav=
e it and that we don&#39;t have <span style=3D"font-family:monospace">cl-de=
structuring-bind</span> either; lower level beast than matching, but useful=
.<br><br></div><div>As per the <span style=3D"font-family:monospace">pcase-=
let</span>, I still think that the name and/or its behavior are confusing b=
ecause of expectations about how a pattern matcher usually works.=C2=A0 Of =
course you have the problems with &quot;no matching&quot; but that semantic=
s can be dealt with separately, without surprising the user (at least me).=
=C2=A0 And note that this is, IMHO, &quot;surprising&quot;.<br><br></div><d=
iv><b style=3D"font-family:monospace">(pcase-let (`(foo bar ,x) &#39;(bar f=
oo 42)) x)</b><br></div><div><br></div><div>IMHO, this should either return=
 <span style=3D"font-family:monospace">nil</span> or signal an error.=C2=A0=
 With=C2=A0<span style=3D"font-family:monospace">destructuring-bind*</span>=
 I would write (assuming indifference variables):<br><br><div><b style=3D"f=
ont-family:monospace">(destructuring-bind* (_ _ x) x)</b><br></div><div><br=
></div><div>All the best</div></div><div><br></div><div>Marco</div><div><br=
></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail=
_attr">On Sun, Apr 28, 2024 at 5:22=E2=80=AFPM Stefan Monnier &lt;<a href=
=3D"mailto:monnier@HIDDEN">monnier@HIDDEN</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.=
8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">&gt; Pattern m=
atchers do ... pattern matching.<br>
<br>
`pcase` is a pattern matcher.<br>
`pcase-let` is not: it performs &quot;destructuring bindings&quot;.<br>
<br>
If you want to test if a pattern matches, then you want to use `pcase`<br>
or `pcase-exhaustive`, and not `pcase-let`.<br>
<br>
If you want a &quot;one-branch `pcase-exhaustive` with a let-style notation=
&quot;,<br>
we could add such a thing of course, but I&#39;d first like to see some<br>
evidence that it&#39;s useful in practice.<br>
<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan<br>
<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Marco Antonio=
tti<br>Somewhere over the Rainbow</div>

--000000000000720ee9061729ee1b--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 15:23:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 11:23:08 2024
Received: from localhost ([127.0.0.1]:50757 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s16Mu-00007B-22
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:23:08 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40856)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1s16Mr-00006B-AS
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 11:23:06 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1EE0510005D;
 Sun, 28 Apr 2024 11:22:40 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1714317759;
 bh=gsndjNMXZcu5vzD972ArjVmwn/PQ/gstol+9S03ffoU=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=nNKqb+izjjd9OgQoYgZ/ldQGSN/HOdRUFDVm1IQzavbfZfoby9QAFkzTvB9TujPEY
 WDcFWsxmSuVBdqEUuAO8XGaIHsE3939SVWhA3QxpQ7TPMZ7wS0UVXuMWlbROqFUvx+
 TMaj2HBX+LxbHPapeSZA9laWOvwFJVyAOFiQCuLwelq8X+2kpFmZbnDpaYWLAAoH88
 R/Q4GvaTq09oZ+exQgm7zhL9Edi3xSLT3rFR1+feN2YoW9edKiws12Bibtn/b9RaEI
 QQfJRyWQ+xgbEqJc/KFswGXRppb9sY1tb3y6yEkKvYzH4kWafveNNTe18uaEUibUul
 997FT2SlDz3Qw==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1829E100035;
 Sun, 28 Apr 2024 11:22:39 -0400 (EDT)
Received: from pastel (unknown [45.72.201.215])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E465F120708;
 Sun, 28 Apr 2024 11:22:38 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 (Marco Antoniotti's message of "Sun, 28 Apr 2024 00:28:41 +0200")
Message-ID: <jwvwmohikiw.fsf-monnier+emacs@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
Date: Sun, 28 Apr 2024 11:22:37 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL 0.038 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: Bruno Barbier <brubar.cs@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Pattern matchers do ... pattern matching.

`pcase` is a pattern matcher.
`pcase-let` is not: it performs "destructuring bindings".

If you want to test if a pattern matches, then you want to use `pcase`
or `pcase-exhaustive`, and not `pcase-let`.

If you want a "one-branch `pcase-exhaustive` with a let-style notation",
we could add such a thing of course, but I'd first like to see some
evidence that it's useful in practice.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 10:19:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 06:19:24 2024
Received: from localhost ([127.0.0.1]:50133 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s11cy-0004oX-Kn
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:19:24 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50904)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1s11cw-0004o7-1Z
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:19:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1s11cW-0008UQ-Fx; Sun, 28 Apr 2024 06:18:56 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=IQ2qBRRl6t3jE49dfkcKceoFoaubvk8ch4xD6EIkBR8=; b=kR1ctgOOU4vi
 +k88SQiKYj2DhzxtOp+gmvgOrsgQI0W1a948mvcv7iZw4wvf129ke+4Qjq1rkmqfdDV2r2eK/0pq7
 sweINtkxEaJv/Y38IA1zAxmn5yAc9V7eZF3y93+mN2fqXrAiOzGrrG3OSrxq/Ke/foH2aybgAYzkd
 vp/0RRKcgYFw0xpJrIxjva9maGvFannr9w9hbTZFOv53Z334wZ6aP+CvXjg4O15oNYj8pF/uuOV/0
 eVk9rbaklFVKLdIeyWbcsfDzZ6VOGZBnnyOpX3ov3s5mbsYP3H+xxYJDzpIee00x2Ql9/hwZ+IL7B
 p3bjvK3DD2UotY5l5Ys/BA==;
Date: Sun, 28 Apr 2024 13:18:46 +0300
Message-Id: <86mspdu6wp.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <87frv5ls0v.fsf@localhost> (message from Ihor Radchenko on Sun,
 28 Apr 2024 10:07:28 +0000)
Subject: Re: bug#70597: Problem in pcase-let?
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <662e1e70.050a0220.3a3a2.45d1@HIDDEN> <87frv5ls0v.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: brubar.cs@HIDDEN, marcoxa@HIDDEN, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Marco Antoniotti <marcoxa@HIDDEN>, 70597 <at> debbugs.gnu.org
> From: Ihor Radchenko <yantar92@HIDDEN>
> Date: Sun, 28 Apr 2024 10:07:28 +0000
> 
> Bruno Barbier <brubar.cs@HIDDEN> writes:
> 
> > So, you would prefer for pcase-let to always signal an error if a
> > pattern doesn't match.  It makes sense.
> >
> > And it looks like the issue has already been raised: see bug#19670.
> >    (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19670)
> 
> Also, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68509

Adding Stefan, in case he has comments.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 10:07:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 06:07:00 2024
Received: from localhost ([127.0.0.1]:50123 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s11Qx-0004dn-N1
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:07:00 -0400
Received: from mout01.posteo.de ([185.67.36.65]:45483)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <yantar92@HIDDEN>) id 1s11Qv-0004dW-Df
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:06:58 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id D7DDF240027
 for <70597 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 12:06:31 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1714298791; bh=qgyQ47ToPRlsrlKmadsyE+51UPmX4X4+PY32qgN2PrA=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=N3DstC4xYH4hNDp0pGISuxhlcY5XzCDf+mPcjb63KMVttOYTYTdaV5qOw/99RsosZ
 lC1JMt0csHa4fjpWyD4wUpRI/Qa3eXZEJOJfjze/x/q/dSNIGzlVWITCBtdcEmxCnq
 b7zFj9Tlg00nwGcSOdoYszUR7Y7KfJZCRnKNnvdGFaNmS6Sie9gBvgkLA1/DqlTNMS
 K0s8lmS3vO7vg8xNGHRiK6zfrceL4LepHjw+BvnKRl746MEdOQfl9Brrq4T3U7+RE4
 IjylDmnTVre3f9Tk3QQjGfPtJ55sJsa8MKiOOmQO4y8arshZJN+9nf/d+fWE9Z+OkP
 ksPpWXlqxKnSg==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4VS2DQ2dP3z9rxB;
 Sun, 28 Apr 2024 12:06:30 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Bruno Barbier <brubar.cs@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <662e1e70.050a0220.3a3a2.45d1@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
 <662e1e70.050a0220.3a3a2.45d1@HIDDEN>
Date: Sun, 28 Apr 2024 10:07:28 +0000
Message-ID: <87frv5ls0v.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 70597
Cc: Marco Antoniotti <marcoxa@HIDDEN>, 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Bruno Barbier <brubar.cs@HIDDEN> writes:

> So, you would prefer for pcase-let to always signal an error if a
> pattern doesn't match.  It makes sense.
>
> And it looks like the issue has already been raised: see bug#19670.
>    (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19670)

Also, see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68509

-- 
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>




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 10:01:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Apr 28 06:01:49 2024
Received: from localhost ([127.0.0.1]:50118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s11Lw-0004Y0-Sl
	for submit <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:01:49 -0400
Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:54678)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brubar.cs@HIDDEN>) id 1s11Lu-0004Xu-Iy
 for 70597 <at> debbugs.gnu.org; Sun, 28 Apr 2024 06:01:47 -0400
Received: by mail-wr1-x429.google.com with SMTP id
 ffacd0b85a97d-346406a5fb9so2980564f8f.1
 for <70597 <at> debbugs.gnu.org>; Sun, 28 Apr 2024 03:01:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714298481; x=1714903281; darn=debbugs.gnu.org;
 h=mime-version:date:references:in-reply-to:subject:cc:to:from
 :message-id:from:to:cc:subject:date:message-id:reply-to;
 bh=NqgYy7n35hLFK2RPUGMdsT+Q+6WOlej/WR4MH5f2Qvc=;
 b=jWHgh2l3bkmdA3UEfF2BZe4Zpk0cYfq5okFgBqyDBU3K8WD6euHPigLEYV5u0/FOE4
 gK3Gbwkr38EZjiyBj06xYrQaZ1/bwse4C0PCoVKo2goYPCMl2x40eGnucSQvTC4i7Md/
 fanPePwy+xWv8EDU3aP2/3c0iI4M4zMuHMHfF6Miz/BqIjetMFN33HdcJNNG/SNEKvbI
 7DY5+4o3C5nfJ2SPavqUpBF1hcoMAuIYEigBYoG+fBFga16bDzMLbPIUW+R4jZ/Opxgy
 33BmC6wP80uq2d/tRc98bbI7wp4+ahEixdlI8oyUFw6+byE0tR1+EgB0swoL+46ZfMVU
 Ogrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714298481; x=1714903281;
 h=mime-version:date:references:in-reply-to:subject:cc:to:from
 :message-id:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=NqgYy7n35hLFK2RPUGMdsT+Q+6WOlej/WR4MH5f2Qvc=;
 b=cx+5mFz9tZ8M5axqfPgCWSUlC7yUlOVGCzYUrsWZ3h47XG8RTTiIiHgis1WmxtsXHk
 8JIPwOuddOKoUBOkX1yCUODq9H0Mq0yWmDYUOkQ+itpNbjVQh3PhwdU5VzT7GNhwlrpJ
 7cOBiGHJGbuoeX18Mye/8aVw7EJ3u7ZawEazfKWpjbUy7uM06Qb+ugU7/J0XkuMGiMu4
 5ysUZLXJ1VNVFDO55vBxpsIse8qTta9eMeothbGO13DX1ACTXJwnBhx1pnNMaktcGZYx
 iQMhbfzz7LAg6LuliyFHTdioUhbtwz3ZI5leZhS+NZo2C/GG6VGwIwZl6uJL0LkcPOYd
 GZfA==
X-Gm-Message-State: AOJu0Yz5wf+vrG9pGQyyLRqE+uPcqFeIXqiGjO9gbTe/NRo6w2zeI+22
 wiQGOPEBUDHeA5quso4GfXi/q382KbwPnqKLt7n1rFQ5X0dfRDVy
X-Google-Smtp-Source: AGHT+IG5oxvKz+9fNxTJfhcJG534hZdpJNfRryfjsVs5MA0b7iqtiG/6Lxpj2hUNDNMj89NFTf2gYA==
X-Received: by 2002:a05:600c:450b:b0:41b:f022:8e69 with SMTP id
 t11-20020a05600c450b00b0041bf0228e69mr1966168wmo.19.1714298481039; 
 Sun, 28 Apr 2024 03:01:21 -0700 (PDT)
Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e])
 by smtp.gmail.com with ESMTPSA id
 h9-20020a05600c350900b0041c120dd345sm1968717wmq.21.2024.04.28.03.01.19
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 28 Apr 2024 03:01:20 -0700 (PDT)
Message-ID: <662e1e70.050a0220.3a3a2.45d1@HIDDEN>
Received: by keynux (sSMTP sendmail emulation); Sun, 28 Apr 2024 12:01:19 +0200
From: Bruno Barbier <brubar.cs@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
 <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
Date: Sun, 28 Apr 2024 12:01:18 +0200
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
Cc: 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hi Marco,

Marco Antoniotti <marcoxa@HIDDEN> writes:

> Hi Bruno
>
> Thank you for the reply, but sorry.  IMHO it is a bug,  At a minimum,
> because pcase and pcase-let behave differently.

> I may be inclined to accept the explanation that the documentation about
> pcase-let allows for the behavior I find incorrect; that does not mean that
> the behavior is what is normally expected.
>
> Pattern matchers do ... pattern matching.  If you allow quasiquotes or
> "incomplete specifications" (pick your preferred pattern matching
> terminology), then you should honor the expectations; hence two symbols
> that are not eq do not match.

So, you would prefer for pcase-let to always signal an error if a
pattern doesn't match.  It makes sense.

And it looks like the issue has already been raised: see bug#19670.
   (see https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19670)



> Also note that I do not have any star (*) operators in my examples.

Thanks for mentionning this.  I now see that you carefully crafted
your HTML version, but, I only used the text version (that is less
readable and contains plenty of stars).  Sorry about the noise,
explaining how to parse generated lightweight markup as elisp :)


> Again, the machinery is there, cfr, the example below, which selects the
> second clause.
>
> ELISP>
>
> *(pcase '(1 2 3 4)           (`(1 2 ,x 5) (list 42 x))           (`(1 ,x 3
> 4) (list 666 x)))*
> *(666 2)*

I'm not sure it's that obvious: pcase doesn't really make a difference
between match and no match:

     (eq (pcase 'b (`a t) (`b nil))
         (pcase 'c (`a t) (`b nil)))
     ==> t


If your request is really like bug#19670, further discussion should
probably go there.

All the best,
Bruno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 27 Apr 2024 22:29:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 18:29:21 2024
Received: from localhost ([127.0.0.1]:49794 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0qXo-0001c9-Cj
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 18:29:20 -0400
Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]:45060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marcoxa@HIDDEN>) id 1s0qXl-0001c1-N8
 for 70597 <at> debbugs.gnu.org; Sat, 27 Apr 2024 18:29:19 -0400
Received: by mail-yw1-x112d.google.com with SMTP id
 00721157ae682-617d25b2bc4so36182967b3.2
 for <70597 <at> debbugs.gnu.org>; Sat, 27 Apr 2024 15:28:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714256933; x=1714861733; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=O1LRTnnQJYx68v572nHp+StdPPNe+/SpzVKnVkkBdco=;
 b=f4FMlsjb/mB1WkMcbvVEJoi1ofSqthemBVSnUjMfwz8Q7ivRKLb43/nvpD1ipbWu+y
 Ls6YQGMhzCzEk2v+WPbZgkaeGKTkhAXjQuX/gZBt3uiDknkb0l4/3IUSP2Ul6AmnDfRX
 YjXC52T+cI7Ldq0TaYpqv2H98Kh+O9z1gavhIyqDEQQPb2tOD5TaYx5xwvlOZM8anmx2
 7vAJOKgdQ+jdobNP2hsdAmvWshytF0QD2SyXRlLjwQy3QJG+LwknTDF5OEPL0pjx8cJk
 h7N+ekLjrOiZX0tYbHxioUL5FGGeGzbtdnaEQJnttDx2ndCUKIVP/MaKE0Ve9GXYHkry
 VQzg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714256933; x=1714861733;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=O1LRTnnQJYx68v572nHp+StdPPNe+/SpzVKnVkkBdco=;
 b=fHp3E6dvjWUU/taXP56vm4a7NT7qP7OzoMXJ3z4qNRdJhiWoKa2HAW10DA68H65Pji
 meAVdpONB/HTWJQH+lSdCnzA2Du0foxmpMN9O4sd3mR+V4sBqbHqOUrmbYuUhzU0y7qb
 T3Jj6kZHmm6vAFp6wmwxoFtHUdQUHshAtWunfDzGz+GQPEJxAMeI1EV5iBMyR/87py7l
 WQvRlZJPc7ykZwgf6v1YM2brEG+azhxqwuk6fSWcRUCOhfiI94Hx8Ybr7KV7dcyowCH1
 YtDV8Ylg1wZ6KdLgE8hvLYHrxD7Arl8TPRc59xXedKF/h1oM3GrsakNAI2bCiTaL2GzD
 YW3A==
X-Gm-Message-State: AOJu0YzwTCAmBJ2jQ4WeF+qY37e4P3UV+9thDRyMjblWgaFbENLrhZ7d
 5XaYyt9gRSpcSxMN5CFG4RhKY5efy6q4PO/DZtgPV980m2eGT/GMGI1at4KN5KMsZOTJByJoMVZ
 JDihtaE+Euk0q2FYYKziprnlh8AeV41G8Ljk=
X-Google-Smtp-Source: AGHT+IH8iCTcdqw681nY6nVIos39cucFig0HaT+Q5CL/ub+/QYk8rreSxEDSk6SMtG11CyMMUYwCpRo10CU/MJfuDBE=
X-Received: by 2002:a05:690c:7448:b0:618:92bd:9334 with SMTP id
 ju8-20020a05690c744800b0061892bd9334mr3544860ywb.43.1714256932655; Sat, 27
 Apr 2024 15:28:52 -0700 (PDT)
MIME-Version: 1.0
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
 <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
In-Reply-To: <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
From: Marco Antoniotti <marcoxa@HIDDEN>
Date: Sun, 28 Apr 2024 00:28:41 +0200
Message-ID: <CAKmY7cXKs_AE_2yBt9CcV7tTkeT4bz0oYFBcadjCfk90b2H00w@HIDDEN>
Subject: Re: bug#70597: Problem in pcase-let?
To: Bruno Barbier <brubar.cs@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000865b7006171b8b7a"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
Cc: 70597 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000865b7006171b8b7a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bruno

Thank you for the reply, but sorry.  IMHO it is a bug,  At a minimum,
because pcase and pcase-let behave differently.

I may be inclined to accept the explanation that the documentation about
pcase-let allows for the behavior I find incorrect; that does not mean that
the behavior is what is normally expected.

Pattern matchers do ... pattern matching.  If you allow quasiquotes or
"incomplete specifications" (pick your preferred pattern matching
terminology), then you should honor the expectations; hence two symbols
that are not eq do not match.  Also note that I do not have any star (*)
operators in my examples.

Again, the machinery is there, cfr, the example below, which selects the
second clause.

ELISP>

*(pcase '(1 2 3 4)           (`(1 2 ,x 5) (list 42 x))           (`(1 ,x 3
4) (list 666 x)))*
*(666 2)*

All the best

MA



On Sat, Apr 27, 2024 at 6:11=E2=80=AFPM Bruno Barbier <brubar.cs@HIDDEN>=
 wrote:

>
> Hi Marco,
>
> I'm not a maintainer but let me try to explain; I'm sure someone will
> correct me if I'm wrong.
>
> In short: not a bug.
>
> If I read your examples correctly, your problem could be reduced to this:
> (using org mode syntax, I hope it's ok):
>
>    #+begin_src elisp
>      (pcase-let
>          ((`(A *,c . ,r) '(A *1 2 3)))
>        (list c r))
>    #+end_src
>
>    #+RESULTS:
>    : (2 (3))
>
>
>    #+begin_src elisp
>      (pcase-let
>          ((`(A *,c . ,r) '(B *1 2 3)))
>        (list c r))
>    #+end_src
>
>    #+RESULTS:
>    : (2 (3))
>
>    #+begin_src elisp
>      (pcase '(A *1 2 3)
>        (`(B *,c . ,r) (list c r)))
>    #+end_src
>
>    #+RESULTS:
>    : nil
>
>
> The pcase-let documentation (describe-function 'pcase-let) says this:
>
>    |    Each EXP should match its respective PATTERN (i.e. be of structur=
e
>    |    compatible to PATTERN); a mismatch may signal an error or may go
>    |    undetected, binding variables to arbitrary values, such as nil.
>
>
> Both of your pcase-let examples are actually undefined, because the
> patterns don't match in *both* cases.  pcase-let works as documented:
> it did bind some variables to arbitrary values.
>
> That one matches (note the space between * and 1):
>    #+begin_src elisp
>      (pcase-let
>          ((`(A * ,c . ,r) '(A * 1 2 3)))
>        (list c r))
>    #+end_src
>
>    #+RESULTS:
>    : (1 (2 3))
>
> That one doesn't match either (replacing * with WORD), but same
> result that your 2 pcase-let examples:
>    #+begin_src elisp
>      (pcase-let
>          ((`(A *,c . ,r) '(A WORD1 2 3)))
>        (list c r))
>    #+end_src
>
>    #+RESULTS:
>    : (2 (3))
>
>
> Note that *1 is one symbol whose name is "*1".  Your pattern `(*,c) is
> looking for the symbol whose name is "*", followed by the value for c.
>
> You may test your pattern, manually binding c to some value, to see
> that you get a list containing 2 values:
>
>    #+begin_src elisp
>      (let ((c 1))
>        `(*,c))
>    #+end_src
>
>    #+RESULTS:
>    : (* 1)
>
> Hoping this helps,
>
> Bruno
>


--=20
Marco Antoniotti
Somewhere over the Rainbow

--000000000000865b7006171b8b7a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi Bruno</div><div><br></div><div>Thank you for the r=
eply, but sorry.=C2=A0 IMHO it is a bug,=C2=A0 At a minimum, because <span =
style=3D"font-family:monospace">pcase</span> and <span style=3D"font-family=
:monospace">pcase-let</span> behave differently.</div><div><br></div><div>I=
 may be inclined to accept the explanation that the documentation about <sp=
an style=3D"font-family:monospace">pcase-let</span> allows for the behavior=
 I find incorrect; that does not mean that the behavior is what is normally=
 expected.<br><br></div><div>Pattern matchers do ... pattern matching.=C2=
=A0 If you allow quasiquotes or &quot;incomplete specifications&quot; (pick=
 your preferred pattern matching terminology), then you should honor the ex=
pectations; hence two symbols that are not <span style=3D"font-family:monos=
pace">eq</span> do not match.=C2=A0 Also note that I do not have any star (=
<span style=3D"font-family:monospace">*</span>) operators in my examples.<b=
r></div><div><br></div><div>Again, the machinery is there, cfr, the example=
 below, which selects the second clause.<br><br><span style=3D"font-family:=
monospace">ELISP&gt; <b>(pcase &#39;(1 2 3 4)<br>=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (`(1 2 ,x 5) (list 42 x))<br>=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (`(1 ,x 3 4) (list 666 =
x)))</b></span></div><div><span style=3D"font-family:monospace"><i>(666 2)<=
/i></span></div><div><br></div><div>All the best</div><div><br></div><div>M=
A</div><div><br></div><div><br></div></div><br><div class=3D"gmail_quote"><=
div dir=3D"ltr" class=3D"gmail_attr">On Sat, Apr 27, 2024 at 6:11=E2=80=AFP=
M Bruno Barbier &lt;<a href=3D"mailto:brubar.cs@HIDDEN" target=3D"_blank=
">brubar.cs@HIDDEN</a>&gt; wrote:<br></div><blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><br>
Hi Marco,<br>
<br>
I&#39;m not a maintainer but let me try to explain; I&#39;m sure someone wi=
ll<br>
correct me if I&#39;m wrong.<br>
<br>
In short: not a bug.<br>
<br>
If I read your examples correctly, your problem could be reduced to this:<b=
r>
(using org mode syntax, I hope it&#39;s ok):<br>
<br>
=C2=A0 =C2=A0#+begin_src elisp <br>
=C2=A0 =C2=A0 =C2=A0(pcase-let<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((`(A *,c . ,r) &#39;(A *1 2 3)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(list c r))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: (2 (3))<br>
<br>
<br>
=C2=A0 =C2=A0#+begin_src elisp<br>
=C2=A0 =C2=A0 =C2=A0(pcase-let<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((`(A *,c . ,r) &#39;(B *1 2 3)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(list c r))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: (2 (3))<br>
<br>
=C2=A0 =C2=A0#+begin_src elisp<br>
=C2=A0 =C2=A0 =C2=A0(pcase &#39;(A *1 2 3)<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(`(B *,c . ,r) (list c r)))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: nil<br>
<br>
<br>
The pcase-let documentation (describe-function &#39;pcase-let) says this:<b=
r>
<br>
=C2=A0 =C2=A0|=C2=A0 =C2=A0 Each EXP should match its respective PATTERN (i=
.e. be of structure<br>
=C2=A0 =C2=A0|=C2=A0 =C2=A0 compatible to PATTERN); a mismatch may signal a=
n error or may go<br>
=C2=A0 =C2=A0|=C2=A0 =C2=A0 undetected, binding variables to arbitrary valu=
es, such as nil.<br>
<br>
<br>
Both of your pcase-let examples are actually undefined, because the<br>
patterns don&#39;t match in *both* cases.=C2=A0 pcase-let works as document=
ed:<br>
it did bind some variables to arbitrary values.<br>
<br>
That one matches (note the space between * and 1):<br>
=C2=A0 =C2=A0#+begin_src elisp <br>
=C2=A0 =C2=A0 =C2=A0(pcase-let<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((`(A * ,c . ,r) &#39;(A * 1 2 3)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(list c r))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: (1 (2 3))<br>
<br>
That one doesn&#39;t match either (replacing * with WORD), but same<br>
result that your 2 pcase-let examples:<br>
=C2=A0 =C2=A0#+begin_src elisp <br>
=C2=A0 =C2=A0 =C2=A0(pcase-let<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((`(A *,c . ,r) &#39;(A WORD1 2 3)))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0(list c r))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: (2 (3))<br>
<br>
<br>
Note that *1 is one symbol whose name is &quot;*1&quot;.=C2=A0 Your pattern=
 `(*,c) is<br>
looking for the symbol whose name is &quot;*&quot;, followed by the value f=
or c.<br>
<br>
You may test your pattern, manually binding c to some value, to see<br>
that you get a list containing 2 values:<br>
<br>
=C2=A0 =C2=A0#+begin_src elisp<br>
=C2=A0 =C2=A0 =C2=A0(let ((c 1))<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0`(*,c))<br>
=C2=A0 =C2=A0#+end_src<br>
<br>
=C2=A0 =C2=A0#+RESULTS:<br>
=C2=A0 =C2=A0: (* 1)<br>
<br>
Hoping this helps,<br>
<br>
Bruno<br>
</blockquote></div><br clear=3D"all"><br><span class=3D"gmail_signature_pre=
fix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature">Marco Antonio=
tti<br>Somewhere over the Rainbow</div>

--000000000000865b7006171b8b7a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at 70597 <at> debbugs.gnu.org:


Received: (at 70597) by debbugs.gnu.org; 27 Apr 2024 16:12:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Apr 27 12:12:11 2024
Received: from localhost ([127.0.0.1]:49566 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0kep-0000A7-AH
	for submit <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:12:11 -0400
Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]:61571)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <brubar.cs@HIDDEN>) id 1s0ken-00009y-22
 for 70597 <at> debbugs.gnu.org; Sat, 27 Apr 2024 12:12:09 -0400
Received: by mail-lj1-x22f.google.com with SMTP id
 38308e7fff4ca-2dfb4ea2bbfso7965881fa.2
 for <70597 <at> debbugs.gnu.org>; Sat, 27 Apr 2024 09:11:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714234304; x=1714839104; darn=debbugs.gnu.org;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :from:to:cc:subject:date:message-id:reply-to;
 bh=2H/csHbUBFMBM838gGnS+ITTAqmW/4eBB5ixSQ9UJYw=;
 b=ZbCH3ANjtLOq33u5Yp67iDxOuKumD4QIjuFkt0WkvXUVqvzn05aEubLfVCBL8Hr07n
 v4ZJuqHyUM+vfLCJNE4/p5etvrg3R/8QOWuMAnJ8oMJXTRnyGCH3lPq7np5ApeYlqJyA
 b7DKwGYdKP48MaDt7Y+wIw8Trsl+bOMKpDjrahNYrvAFqmvLJF3V5JDFauDLVLUGhbCN
 syic3xShIjXbrSOSZSr8N5I0Y+iaPLW683oiFkJAEtnya3U3I5Y0SI67wwyqFGAyEVr4
 Uq5627tAmvpClhZE9QfIGkN4XdYSipK6lpt4QJzCjfIBWsA6UPRO5j89V4pz5YgFp19x
 LZrA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714234304; x=1714839104;
 h=mime-version:date:references:in-reply-to:subject:to:from:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=2H/csHbUBFMBM838gGnS+ITTAqmW/4eBB5ixSQ9UJYw=;
 b=aOx5eRjTDizyyJ7z2L80LLCtgj6bjFA1QloE5ZoxMGlMPZNaikjvAZPDunRFh3Hbck
 wHgfkW6xidffkkqB83rL+K03VyFpPWBSuNL84LqfW9H6SBiCsMbcxg0jgLBW0UOWjvMV
 1dYNXk5HrdbHECCV26SS+DjWuJFRz6Sokn47fxt0jzfeffG76PASVjkZTbg6GuiSOqvo
 vn7jqRnY4yU+U41xHKNyDEvdBiLu6byLg+F3F7G6fZIAJeghDAExEUpbEshX4swpZs7E
 EjcW6nk0aocfWRyIe9DbXR4iZtmZPz1LFdUog4CoYeu94M1LRiwe0RplRiOTAJ/NwAXY
 jbFQ==
X-Forwarded-Encrypted: i=1;
 AJvYcCW1cA7GhNhoGRsHtaOYqTi2rwyxTik9B5pT8TGhvy6e1aAZ4utdclwh+IddQoqVr3xouRyX7lwkTVz4Q1GsIjHxy5a5NgY=
X-Gm-Message-State: AOJu0Yzc4Nhifw7LsTxZrCRvBFQkkLRIogYREc3Ys9R0RLrzjJF+7JGK
 CIgMHb5ON3kKEgUbxtNKMmeVrHBzJlEPvkV6QXt0VmYblMgC/MD9
X-Google-Smtp-Source: AGHT+IEwuxWPnLE2eok8TXH8u9mGUTBiX2wA/w6UtyDebTYqfEmMvvG7VlReqm6A24IKqgW4C6zdHw==
X-Received: by 2002:a2e:9545:0:b0:2da:bbf4:81b8 with SMTP id
 t5-20020a2e9545000000b002dabbf481b8mr3088454ljh.14.1714234303638; 
 Sat, 27 Apr 2024 09:11:43 -0700 (PDT)
Received: from keynux ([2a01:e0a:505:3460:1c18:688d:ece4:372e])
 by smtp.gmail.com with ESMTPSA id
 r21-20020a05600c35d500b0041bf45c0665sm1218855wmq.15.2024.04.27.09.11.42
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 27 Apr 2024 09:11:43 -0700 (PDT)
Message-ID: <662d23bf.050a0220.a4e2f.3f45@HIDDEN>
Received: by keynux (sSMTP sendmail emulation); Sat, 27 Apr 2024 18:11:41 +0200
From: Bruno Barbier <brubar.cs@HIDDEN>
To: Marco Antoniotti <marcoxa@HIDDEN>, 70597 <at> debbugs.gnu.org
Subject: Re: bug#70597: Problem in pcase-let?
In-Reply-To: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
References: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
Date: Sat, 27 Apr 2024 18:11:41 +0200
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70597
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Hi Marco,

I'm not a maintainer but let me try to explain; I'm sure someone will
correct me if I'm wrong.

In short: not a bug.

If I read your examples correctly, your problem could be reduced to this:
(using org mode syntax, I hope it's ok):

   #+begin_src elisp 
     (pcase-let
         ((`(A *,c . ,r) '(A *1 2 3)))
       (list c r))
   #+end_src

   #+RESULTS:
   : (2 (3))


   #+begin_src elisp
     (pcase-let
         ((`(A *,c . ,r) '(B *1 2 3)))
       (list c r))
   #+end_src

   #+RESULTS:
   : (2 (3))

   #+begin_src elisp
     (pcase '(A *1 2 3)
       (`(B *,c . ,r) (list c r)))
   #+end_src

   #+RESULTS:
   : nil

         
The pcase-let documentation (describe-function 'pcase-let) says this:

   |    Each EXP should match its respective PATTERN (i.e. be of structure
   |    compatible to PATTERN); a mismatch may signal an error or may go
   |    undetected, binding variables to arbitrary values, such as nil.


Both of your pcase-let examples are actually undefined, because the
patterns don't match in *both* cases.  pcase-let works as documented:
it did bind some variables to arbitrary values.

That one matches (note the space between * and 1):
   #+begin_src elisp 
     (pcase-let
         ((`(A * ,c . ,r) '(A * 1 2 3)))
       (list c r))
   #+end_src

   #+RESULTS:
   : (1 (2 3))

That one doesn't match either (replacing * with WORD), but same
result that your 2 pcase-let examples:
   #+begin_src elisp 
     (pcase-let
         ((`(A *,c . ,r) '(A WORD1 2 3)))
       (list c r))
   #+end_src

   #+RESULTS:
   : (2 (3))
   

Note that *1 is one symbol whose name is "*1".  Your pattern `(*,c) is
looking for the symbol whose name is "*", followed by the value for c.

You may test your pattern, manually binding c to some value, to see
that you get a list containing 2 values:

   #+begin_src elisp
     (let ((c 1))
       `(*,c))
   #+end_src

   #+RESULTS:
   : (* 1)

Hoping this helps,

Bruno




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 Apr 2024 21:14:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 26 17:14:41 2024
Received: from localhost ([127.0.0.1]:38557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s0Su0-0000Rf-5b
	for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 17:14:40 -0400
Received: from lists.gnu.org ([2001:470:142::17]:33174)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <marcoxa@HIDDEN>) id 1s0PsJ-0006cB-V8
 for submit <at> debbugs.gnu.org; Fri, 26 Apr 2024 14:00:46 -0400
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 <marcoxa@HIDDEN>) id 1s0Pru-0003ii-HG
 for bug-gnu-emacs@HIDDEN; Fri, 26 Apr 2024 14:00:19 -0400
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 <marcoxa@HIDDEN>) id 1s0Prr-0003yp-U0
 for bug-gnu-emacs@HIDDEN; Fri, 26 Apr 2024 14:00:17 -0400
Received: by mail-yb1-xb33.google.com with SMTP id
 3f1490d57ef6-de5acdb3838so969625276.1
 for <bug-gnu-emacs@HIDDEN>; 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)
MIME-Version: 1.0
From: Marco Antoniotti <marcoxa@HIDDEN>
Date: Fri, 26 Apr 2024 20:00:02 +0200
Message-ID: <CAKmY7cWtrOZ5gCgELraucvznb+6+72mZpGHoMdcKeEeuAwL3sQ@HIDDEN>
Subject: Problem in pcase-let?
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary="000000000000efe4de061703ac76"
Received-SPF: pass client-ip=2607:f8b0:4864:20::b33;
 envelope-from=marcoxa@HIDDEN; 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-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Fri, 26 Apr 2024 17:14:38 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--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

<div dir=3D"ltr"><div>Hi</div><div><br></div><div>This is for GNU Emacs 29.=
2 (build 2, x86_64-w64-mingw32) of 2024-02-01 running on Windows 11.</div><=
div><br></div><div>I just noticed the following with <span style=3D"font-fa=
mily:monospace">pcase-let</span> and <span style=3D"font-family:monospace">=
pcase</span>.=C2=A0 I believe this is a problem with <span style=3D"font-fa=
mily:monospace">pcase-let</span>.=C2=A0 The following is a IELM transcript.=
=C2=A0 The second <span style=3D"font-family:monospace">plet-case</span> sh=
ould, IMHO, fail.<br></div><div><br></div><div><span style=3D"font-family:m=
onospace">ELISP&gt; (pcase-let ((`(let ,bs (<b>when </b>,c . ,r)) &#39;(let=
 ((foo 42)) (<b>when </b>1 2 3))))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(li=
st &#39;bs bs &#39;c c &#39;r r))<br>(bs<br>=C2=A0((foo 42))<br>=C2=A0c 1 r=
<br>=C2=A0(2 3))</span></div><div><span style=3D"font-family:monospace"><br=
></span></div><div><span style=3D"font-family:monospace">ELISP&gt; (pcase-l=
et ((`(let ,bs (<b>when </b>,c . ,r)) &#39;(let ((foo 42)) (<b>zot </b>1 2 =
3))))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(list &#39;bs bs &#39;c c &#39;r=
 r))<br>(bs<br>=C2=A0((foo 42))<br>=C2=A0c 1 r<br>=C2=A0(2 3))<br><br>ELISP=
&gt; (pcase &#39;(let ((foo 42)) (<b>when </b>1 2 3))<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0(`(let ,bs (<b>zot </b>,c . ,r)) (list &#39;bs bs &#39;c c=
 &#39;r r)))<br>nil<br></span></div><div><br></div><div><span style=3D"font=
-family:monospace">pcase </span>correctly fails to match <b><span style=3D"=
font-family:monospace">when </span></b>and <b><span style=3D"font-family:mo=
nospace">zot</span></b>, while <span style=3D"font-family:monospace">pcase-=
let</span> seems to happily go ahead.</div><div><br></div><div>All the best=
</div><div><br></div><div><span class=3D"gmail_signature_prefix">-- </span>=
<br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_sign=
ature">Marco Antoniotti<br>Somewhere over the Rainbow</div></div></div>

--000000000000efe4de061703ac76--




Acknowledgement sent to Marco Antoniotti <marcoxa@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#70597; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sat, 4 May 2024 11:45:02 UTC

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