From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70597: Problem in pcase-let? Date: Sun, 28 Apr 2024 13:05:26 -0400 Message-ID: References: <662d23bf.050a0220.a4e2f.3f45@mx.google.com> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25934"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Bruno Barbier , 70597@debbugs.gnu.org To: Marco Antoniotti Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 28 19:06:02 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 1s17yT-0006WY-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Apr 2024 19:06:02 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s17yD-0006gf-Ve; Sun, 28 Apr 2024 13:05:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s17yB-0006g5-D2 for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:05:43 -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 1s17yB-0001zg-4B for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:05:43 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s17yU-0001Pz-I5 for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Apr 2024 17:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70597 X-GNU-PR-Package: emacs Original-Received: via spool by 70597-submit@debbugs.gnu.org id=B70597.17143239565445 (code B ref 70597); Sun, 28 Apr 2024 17:06:02 +0000 Original-Received: (at 70597) by debbugs.gnu.org; 28 Apr 2024 17:05:56 +0000 Original-Received: from localhost ([127.0.0.1]:51255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s17yO-0001Pl-Da for submit@debbugs.gnu.org; Sun, 28 Apr 2024 13:05:56 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s17yM-0001Pb-09 for 70597@debbugs.gnu.org; Sun, 28 Apr 2024 13:05:55 -0400 Original-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== Original-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) Original-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) In-Reply-To: (Marco Antoniotti's message of "Sun, 28 Apr 2024 17:38:30 +0200") 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:284100 Archived-At: > 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