From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.bugs Subject: bug#71503: 30.0.50; pcase-lambda (with "and" and "guard") does not work as expected Date: Sun, 04 Aug 2024 14:54:44 +0000 Message-ID: <87bk28z6bv.fsf@posteo.net> References: <87r0d2lfjd.fsf@posteo.de> <87h6dvud8u.fsf@posteo.net> <86tthlidap.fsf@gnu.org> <86frsn55t3.fsf@gnu.org> <865xt0e6wc.fsf@gnu.org> <87ikx0mk4c.fsf@posteo.net> <87sew2ly1n.fsf@posteo.net> <86r0b4sos7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: mekeor@posteo.de, Stefan Monnier , 71503-done@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 04 16:56:11 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 1saceX-0005Vp-Ow for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Aug 2024 16:56:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sace8-0000Wh-8k; Sun, 04 Aug 2024 10:55:44 -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 1sace6-0000Vy-4t for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 10:55:42 -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 1sace5-0004a1-SE for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 10:55:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=sVVe51eUCu39la6/a7w4K3Kc4HQQ6dVfyYJGKvhqr0k=; b=OUiw8QPHP1SS+SOcGJTqvtN15OKVLp1HnHNgR/buswJmyAtuPNvLe6Jrexpxg9sIuIz28x4/ETIU86gLQHJPH6sA03ns5lK1YKTn9+K30J1Qj+4I7Ejl41F2U3W20qM1DCDY1ThiodqxmU2S3swWOxOafm+aOrLS4zWT4Zr7/H44HcKAuud8Ujsy+mhdg4nG8ornjx8EPbr2iAqgWT8a8bb/zUsZf7BGVkYxKjLnZaD+mIQEN2NCfUbObvv1MLithRQTIKBvluhW60zLu4n+qh7HiUA5h2iJPjd3vb9loz01Mu4O/Gjk5NRRllG6cx0s6z5x/ox97evnX8mmS1sHLQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1saceQ-0002Fp-RF for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 10:56:02 -0400 Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Aug 2024 14:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 71503 X-GNU-PR-Package: emacs Mail-Followup-To: 71503@debbugs.gnu.org, philipk@posteo.net, mekeor@posteo.de Original-Received: via spool by 71503-done@debbugs.gnu.org id=D71503.17227833198534 (code D ref 71503); Sun, 04 Aug 2024 14:56:02 +0000 Original-Received: (at 71503-done) by debbugs.gnu.org; 4 Aug 2024 14:55:19 +0000 Original-Received: from localhost ([127.0.0.1]:56953 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacdi-0002DZ-Kp for submit@debbugs.gnu.org; Sun, 04 Aug 2024 10:55:19 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:53101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sacdg-0002D3-4t for 71503-done@debbugs.gnu.org; Sun, 04 Aug 2024 10:55:16 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id E94F7240029 for <71503-done@debbugs.gnu.org>; Sun, 4 Aug 2024 16:54:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722783286; bh=DUCL8wTprjUOle1xqDS4hQP+GxxsS+1Y1S0sEwTAhsw=; h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version: Content-Type:From; b=K4QURgv4RgCWzgV5EwXaix/s6orqFSB9umb6ybgVno6XYbbXUxPUz09yfTzWiCxCT iiPGagr3sblbJpAT8smkiY3uz0HmJhypO2ZfB5MlAausY9KDW7rTcZsnnp4y3RxlQU aQ+BlSuO1eIJiLSxPXXMPQmCfhv/bpe2zRQHUc23OD4M49YqjMTD3Z38mwT2H6pmzt IYNZSRgYFQdgEcN8yscNZfspur1te7finDL3HDnz3tlplHjb8b4uZgaQyOF43H4YIx yrUd/x5xMAsjh98QXokvbbwNoiM77eNC3UkwS2qSlfU7Wyo3Db01pD7R0MMeMMtzt7 Zq18RFJXTpclg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WcMzn2lrFz9rxN; Sun, 4 Aug 2024 16:54:45 +0200 (CEST) In-Reply-To: <86r0b4sos7.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 04 Aug 2024 10:58:00 +0300") Autocrypt: addr=philipk@posteo.net; keydata= mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof z4oM OpenPGP: id=philipk@posteo.net; url="https://keys.openpgp.org/vks/v1/by-email/philipk@posteo.net"; preference=signencrypt 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:289757 Archived-At: Eli Zaretskii writes: > Ping! can we please make progress with this issue, one way or > another? I've pushed the change in 0756f308 that Mekeor previously acknowledged as fine. Closing. >> From: Stefan Monnier >> Cc: Eli Zaretskii , mekeor@posteo.de, 71503@debbugs.gnu.org >> Date: Sun, 21 Jul 2024 09:51:04 -0400 >> >> > Another confusing behaviour that we should document is that in >> > >> > (let ((a nil)) >> > (funcall >> > (pcase-lambda (a (and (guard a) b)) >> > (list a b)) >> > 1 2)) >> > >> > I would expect that the (guard a) would use the nil binding from the >> > `let' form, but instead it is ignored and b is bound to 2. I am not >> > sure if this is related to the "destructing" point or not. >> >> It most definitely is: the `guard` controls here whether the pattern >> matches or not, but since it's a destructuring match `pcase` takes it >> for granted that the pattern does match, so the guard is ignored. >> >> What might be more confusing is the scoping, e.g.: >> >> (macroexpand '(pcase-lambda ((and (guard a) b) a) (FOO))) >> => >> #'(lambda (arg0 a) (pcase-let* (((and (guard a) b) arg0)) (FOO))) >> >> so the `a` in the guard refers to the argument that follows rather than >> to a surrounding `a` binding. >> >> >> Stefan >> >> -- Philip Kaludercic on peregrine