From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#59887: pcase vs. pcase-let: Underscore in backquote-style patterns Date: Tue, 13 Dec 2022 03:21:45 +0100 Message-ID: <87a63s2gcm.fsf@web.de> References: <87sfhrqgxw.fsf@airmail.cc> <87v8mhmj26.fsf@web.de> <87pmco8nyc.fsf@airmail.cc> <87edt42jaz.fsf@web.de> <87lenc84df.fsf@airmail.cc> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7932"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59887-done@debbugs.gnu.org To: hokomo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 13 03:22:23 2022 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 1p4uw1-0001oy-Bs for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Dec 2022 03:22:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4uvl-000093-0e; Mon, 12 Dec 2022 21:22:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4uvj-00008v-Hp for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 21:22:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4uvi-0006Ac-UO for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 21:22:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4uvi-00038m-HJ for bug-gnu-emacs@gnu.org; Mon, 12 Dec 2022 21:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2022 02:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59887 X-GNU-PR-Package: emacs Original-Received: via spool by 59887-done@debbugs.gnu.org id=D59887.167089811912066 (code D ref 59887); Tue, 13 Dec 2022 02:22:02 +0000 Original-Received: (at 59887-done) by debbugs.gnu.org; 13 Dec 2022 02:21:59 +0000 Original-Received: from localhost ([127.0.0.1]:57153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4uvf-00038Y-AX for submit@debbugs.gnu.org; Mon, 12 Dec 2022 21:21:59 -0500 Original-Received: from mout.web.de ([217.72.192.78]:55433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4uvc-00038S-Mu for 59887-done@debbugs.gnu.org; Mon, 12 Dec 2022 21:21:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1670898109; bh=staBi3cOG6/RVcBAe1HuiRfqq6Wk18owgkybodshDb4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=fyUdo4WN9yKWtNeUrBchKm1HiNTV3flgNd1FRjPyeMg6xCCly2rqMyTp4CCLo7g6E r7XB6xBy6NjzR4tM3oIpLpBBE2JXWdtStp4TaMjrklOONkduBfvPWTDA7ZWh/jVjic P98v+WQZxaNTUGSoeQc5uh2NdV7SCXYrvplbxwgCe1LxdlAh4DbJUApXR89oKJOfH+ tWA/deOclTF4U0hwwCPZZ/+RM3oJJCTI55Gv4LyBgo5ydjtumkRF2mjlLAuRLwfoOI di3d4BaqYSn6F/ZwNIehTQmkedNFfN+ebTJWdvv//b43bBYtloVrBXvf0aQ7m3GUNh APGemHmi5/Z4A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Original-Received: from drachen.dragon ([92.76.229.140]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M3Eut-1p5knp41TZ-003YGH; Tue, 13 Dec 2022 03:21:49 +0100 In-Reply-To: <87lenc84df.fsf@airmail.cc> (hokomo@airmail.cc's message of "Tue, 13 Dec 2022 02:19:22 +0100") X-Provags-ID: V03:K1:wUW3EyRQZWmJbMDLpVcXbIO8DZP4UoDU5XhyOzIP7a3p58A9kZz QfiSwudPuvhaaw+iA3n1Da4wyL1V33k1B64oKakdvPg8n+jZxQy5d3HyEbTEOcVM/C9rwKF ky+FM+hG6PGdYSMdI5UgVBGE2YkXNkIJXkDVWYQo2emIfCT/SyjSNOxiEnzMsuVUG6iAoSS wz1SsMSjv+p/E0uUy4WPg== UI-OutboundReport: notjunk:1;M01:P0:rZvGCGZsx8I=;X+ks/nZE+upv68CdnX7+hSiWNYS 2dMIMrKf/Wh9CSmQklHq26SCrusGEEsTa2AIghBHng5inH2SQyQy1dsA9jlgSZWIGn73NgS9R sKRdMA9QDtliSfA8wTlpcxelLH6OPkqT59hVllhuRiD/uhuubbU7QXOoo4I04cuKsF7h3jHHb A7JPmOJIClclixQanJNjyF8PURp43XyWcI5NVAnqBfCJ6BzJQtnaNB6cZsP53PN1LCh6eKQvk rczysxyw8Q7LWAeCGZ/6CLIAt6zaxJ0Vx2D8smNPocnJuS1bqo4KxW7qMYW+D2oy0+fpGsVEN ho2MNqGKAWqBEayU6c0ccmb7TIqtWFgNoEfjYPrHvmMO1Ye2DzctT1NE8qt8+Xj3zjMt1faZB zWJb+Q1L/1U5gtCc7VNOzTt4KaqVuq04Bdj3nEE/91Dx/2fpT3vCQH6ZubvPP3GQFECMPlVzS vyquboZIfe6/yjfmHxpwpNOdOv51q5vX/2zSrsX1VCBrkoapyt6qC5e9gTeFCKRQIPq4Bklb5 5+N1Lylp8aiCe5UGl1gSEJQtCcLxBln1jiW1E62AFcX2PvP8eakRll61V/PN3n1lwtn6QHu5k So0KhVd85FFeZJ3XQuiniyVgW7er0s7waG6aBWwe1osh0WorhZrYtyTibKXwIMwWyGBWIP4ha tLBvyiTMJPfWtZ0Y3Efi5zmtZWQEEkH7JAd76MOMQKwjzuh18G/xE25Y4si67mYVIvaF3pY1K QUGaZAEQzh2xNB3rKx/hU99nx9zSFcU5WRYIf4pK/wQZdxKB1J6e/eoZnf+mm0oaEuNg9nKI 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:250796 Archived-At: hokomo writes: > That indeed describes it nicely. Somehow I managed to miss that whole > paragraph and instead skipped directly to the documentation string of > pcase-let. My bad... :-) > > > Or should we maybe just warn about the possible pitfall a bit more > > offensively? > Perhaps including a variation of the phrase "Each EXP should match > (i.e. be of compatible structure)" in each of the four descriptions > would hint at this behavior while not being overly verbose? From that > point the user can search for "compatible" on the same page and > immediately find a match in the text at the top that explains the > constraints. My question is that when we make the text even longer, would that help people that don't read carefully (because we don't need to address others) at all? My second question is if that would have helped you at all, because your crucial misunderstanding was about the meaning of `_`. Using patterns in `pcase-let' that don't match generally doesn't make much sense, it's totally unclear what would happen in this case. That's another reason why I don't want to over-emphasize this case. Maybe saying that `_` is not special when used as a QPAT would make sense, in (info "(elisp) Backquote Patterns"). I mean in this paragraph: | =E2=80=98SYMBOL=E2=80=99 | =E2=80=98KEYWORD=E2=80=99 | =E2=80=98NUMBER=E2=80=99 | =E2=80=98STRING=E2=80=99 | Matches if the corresponding element of EXPVAL is =E2=80=98equal=E2= =80=99 to the | specified literal object. We could add that `_` is not special (no symbol is special as a qpat, actually). Would that give a useful hint? It seems that some people seem to expect that `_` is special everywhere in pcase. Michael.