From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Earl Hyatt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#47261: Fwd: bug#47261: Destructuring with Pcase without assigning values Date: Mon, 19 Apr 2021 22:06:51 +0000 Message-ID: <42f78acc-b2f3-9bfd-8891-d316b7a95e1c@protonmail.com> References: <08c47ffc-58a3-d4f9-eae1-61a672d45b44@protonmail.com> <1dacded9-3e40-bc02-56c7-a157d739ffb7@protonmail.com> Reply-To: Earl Hyatt 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="21118"; mail-complaints-to="usenet@ciao.gmane.io" To: 47261@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 20 00:32:09 2021 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 1lYcR7-0005OP-BB for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 20 Apr 2021 00:32:09 +0200 Original-Received: from localhost ([::1]:57730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYcR6-0000JY-DQ for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Apr 2021 18:32:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYcR0-0000JH-1R for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 18:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40759) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYcQz-0000fY-Pu for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 18:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lYcQz-0001Ri-MX for bug-gnu-emacs@gnu.org; Mon, 19 Apr 2021 18:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Earl Hyatt Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Apr 2021 22:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47261 X-GNU-PR-Package: emacs Original-Received: via spool by 47261-submit@debbugs.gnu.org id=B47261.16188715065535 (code B ref 47261); Mon, 19 Apr 2021 22:32:01 +0000 Original-Received: (at 47261) by debbugs.gnu.org; 19 Apr 2021 22:31:46 +0000 Original-Received: from localhost ([127.0.0.1]:52305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYcQg-0001R8-BT for submit@debbugs.gnu.org; Mon, 19 Apr 2021 18:31:45 -0400 Original-Received: from mail-40134.protonmail.ch ([185.70.40.134]:60637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lYc2n-0000qc-Jm for 47261@debbugs.gnu.org; Mon, 19 Apr 2021 18:07:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1618870015; bh=BeiVX9ihKl3r3FJ+mCskx5Tam3YjxPHhHorWTRrismg=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=yPL8gJaKkkyId5SXh83MMlyx6xLP01TfBuvECjHGFXoS1TEDGCzl7NFgPKu8MbKcV AZo5az143sTNbbe7UIb6EhKzqz3Z9H9FL2F2MtGNtyDWUmfAAFPqzQ9H2GmYesqgEo ghspPns9rsg7qT2TjOtbgvVJ5gX4LDyPdttAM1jA= In-Reply-To: <1dacded9-3e40-bc02-56c7-a157d739ffb7@protonmail.com> X-Mailman-Approved-At: Mon, 19 Apr 2021 18:31:41 -0400 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" X-ACL-Warn: , Earl Hyatt Xref: news.gmane.io gmane.emacs.bugs:204518 Archived-At: For the record, I am forwarding this reply to the bug tracker. I forgot to send the original message to the tracker. -------- Forwarded Message -------- Subject: Re: bug#47261: Destructuring with Pcase without assigning values Date: Sat, 17 Apr 2021 18:50:10 -0400 From: Okam To: Stefan Monnier On 4/16/21 11:22 PM, Stefan Monnier wrote: > >>> The `pcase` macro itself uses this function, so it should hopefully be >>> "good enough", but let me know if it's causing you trouble. >> This seems to work well for my use case. Thank you for making this chang= e. > > You're welcome. It was actually a good change for the code's > readability as well. > >> Are the variables always given in the order that they appear in the >> pattern? > > I don't know. Why? > >> If not, is finding elements of the form "(\, SYMBOL)" enough to >> identify variables in a Pcase pattern? > > No. , is not even one of the core pcase patterns, it's only something > used within the ` pattern (which is not a core pattern either; it is > defined via `pcase-defmacro`). > > > Stefan > In the `cl-loop`-like macro that I am writing, things are currently set up so that variables being assigned values in accumulation clauses can be automatically used as the return value of the macro. ;; =3D> ((1 3 5) (2 4 6)) (loopy (flag pcase) (list i '((1 2) (3 4) (5 6))) (collect `(,a ,b) i)) This behavior requires finding the variables in the correct order. The getting of the variables used ("a" and "b" above) can be done when using the new `pcase-compile-pattern`, if the variables are fed to the CODEGEN argument in the order that they are written, or I can try to find them manually, if possible. If neither are possible, then I will just remove this behavior. Thank you.