From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: pcase bindings in patterns with complicated logic Date: Sun, 14 Jan 2024 07:27:39 +0000 Message-ID: <87wmscidck.fsf@posteo.net> References: <87il3xt38w.fsf@localhost> <875xzwjta2.fsf@posteo.net> 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="11638"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 14 08:28:39 2024 Return-path: Envelope-to: ged-emacs-devel@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 1rOuv9-0002rp-I4 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Jan 2024 08:28:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOuuN-0002ng-H5; Sun, 14 Jan 2024 02:27:51 -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 1rOuuM-0002lk-8M for emacs-devel@gnu.org; Sun, 14 Jan 2024 02:27:50 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOuuJ-00028i-K9 for emacs-devel@gnu.org; Sun, 14 Jan 2024 02:27:49 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 46504240027 for ; Sun, 14 Jan 2024 08:27:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1705217265; bh=MB6ZqAmMmVDw6LlkcvSnuxqgY5t7QjV8miFy/BwEg8g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:Autocrypt:OpenPGP:From; b=hBIyDmrWG9YEf2ZT7wyjDy9v4gFxFD+Ttt0HDZEWZejkX2BLFLtueOnqQoO3Rs0OH 5vhmK6iSxlfbB5n/souKEU4foM2QRvlJWADrr7HpjY/3n1VP9f4dPPJGz/EyXaV1om Nt1TnFP4mzl9ia8uCCVYfmn/wHq8Gnlh4YpkxahzZmoSeMSlqtaz8xbxnTpqlOcptk TiP2Ya1uqznMi2JIHmFJJE3i5i27ZoHu0RpCAuZXS35M1UOH/kOlIgpzrBsdu/ghxS NUM0UQ4zMf90FajBmASFy1Oo7PdzLHjEeoXZnqqj+mECLvefBiAtBMRo48OdirTEDw L5EuqtaQAHJYA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TCRgg6BJzz6tvd; Sun, 14 Jan 2024 08:27:43 +0100 (CET) In-Reply-To: <875xzwjta2.fsf@posteo.net> (Thierry Volpiatto's message of "Sun, 14 Jan 2024 06:58:13 +0000") Autocrypt: addr=thievol@posteo.net; prefer-encrypt=mutual; keydata=xsDNBF8ylcIBDADG+hy+zR6L4/vbdDDZuSaMmSrU3A5QZJpeBCvxTr7MpzzruZbhLPW1K3R6N2MA edi8Y+C8o27FVRIjpdbaKMGu9je7JV/TbUQYo3SOwCK1vM4LUn4V6ZLzSYkuiEt4eyMoiDdyvN0p kcK6P9x9DCetcEVszXzQg+yzCVrQ2hXWDXWT4M18EC3wtO7RHPouMqGiwBFhBAYErCqFWFxQHkfb tG/4yGyJ58rglb65O3qijjMWvYwcWZun9/7qm8Z4/4mHopmo2zgU+OrptnLSZfkZGz3Y7Uf452xQ GVq0Fv75NPvQru7y+DYVhuVXXyAmGxt+vf4rIiixMBbhKEPjcxEPAa2LTzex2IsTZR+QVG9uDnqC WcgaOEQ58fzXNvNhtwwF/Rgio2XWAJVdmFWS59/k9W58CIUSNKBMZh2XeGdEmtHvDtCxW3z6FJha 36RzOM3fMNNiAGdFZJA84gcdloJR+sHCDTTPT3784fjr+V8An7sI581NGFzkRQqPvEQCZbUAEQEA Ac0SdGhpZXZvbEBwb3N0ZW8ubmV0wsEOBBMBCgA4AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheA FiEEI9twfRN7r3nig/xwDsVtFB0W75MFAmL3HCoACgkQDsVtFB0W75OVEAv/f6XxmtIFz08fUb8h Bp/zJP6IC4/rhhh+0GMRIRzLN8DK0jV8JCzYdFHiRJOy2lNIOpmrrCmjRRxferc2G42+ePFIsslx hU46VSz1Z83NwIG3mpdYNV5WUTUdgzxExHTNTFCd7NKv0nlHKQaA OpenPGP: url=https://posteo.de/keys/thievol@posteo.net.asc; preference=encrypt Received-SPF: pass client-ip=185.67.36.65; envelope-from=thievol@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:314954 Archived-At: Thierry Volpiatto writes: > I guess there is other examples in documentation that are mismatching > with the actual behavior of pcase or are just confusing like this one in > "11.4.4 Destructuring with =E2=80=98pcase=E2=80=99 Patterns": > > (pcase my-list > (`(add ,x ,y) (message "Contains %S and %S" x y))) > > I guess this example has been added before the pattern `add` exists. > Here `add` is a symbol like any other symbol and has no particular > meaning but it is confusing for reader that has not completely > integrated previous sections (I would use `foo` instead). For this example, sorry I confuse `add` and `app` (proof it is confusing :-)). > [ BTW I don't understand why `add` pattern exists as long as now `pred` is > supporting an extra arg ] Here read `app` instead of `add`. --=20 Thierry