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#49809: [PATCH] Add macro 'pcase-setq' Date: Fri, 06 Aug 2021 00:07:07 -0400 Message-ID: References: <07ad5892-3343-4c35-00e3-9753bca5f67b@protonmail.com> <87sfzowvp0.fsf@web.de> <87pmurs613.fsf@web.de> 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="1508"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Okam , 49809@debbugs.gnu.org To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 06 06:08:10 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 1mBr9W-0000Bs-0Z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Aug 2021 06:08:10 +0200 Original-Received: from localhost ([::1]:41806 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBr9T-0001bN-So for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Aug 2021 00:08:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBr9O-0001bE-BZ for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 00:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBr9O-0007rB-4X for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 00:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBr9O-00010M-00 for bug-gnu-emacs@gnu.org; Fri, 06 Aug 2021 00:08: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: Fri, 06 Aug 2021 04:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49809 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49809-submit@debbugs.gnu.org id=B49809.16282228383806 (code B ref 49809); Fri, 06 Aug 2021 04:08:01 +0000 Original-Received: (at 49809) by debbugs.gnu.org; 6 Aug 2021 04:07:18 +0000 Original-Received: from localhost ([127.0.0.1]:48833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBr8g-0000zI-1S for submit@debbugs.gnu.org; Fri, 06 Aug 2021 00:07:18 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:63968) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBr8d-0000z2-J5 for 49809@debbugs.gnu.org; Fri, 06 Aug 2021 00:07:16 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 6CE8B8090A; Fri, 6 Aug 2021 00:07:09 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2A437803F9; Fri, 6 Aug 2021 00:07:08 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1628222828; bh=ue5yA++/6zBhcNTXZN5YcA7N+PqCQb5CBKsxSoq+JlA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=D04j9Zgl+zF4v+C9PXKLiNDua1MiSVSBRNGPpjDdzJwrDzva0qV7i8vQLB7KNRCqo 4ezvvxnAQXF4e4ETMojX/Gn28HySaH14UQB4aRlSQfeJ9BRt+MCqJvNlJ9HZFaLLee pbhAsoYpE+ZV5a4Warg9gp3JRtv7fneMzf1x5nIrKBy7GsG1G2a013f2Z/umO+RlE5 ke0CyKYvBtQPuW1iWk5BXkXSLGDVnL5qDsm0p9gHLDrTBLZiyALPSemUcj91knd61I xptCO6/y9l3qskmwCB9rZcUTfJP0+5UqhDMoXod3BBkfxubvmsB+MkJnorcGB1pI28 H6LsUNWiSVw/w== Original-Received: from alfajor (unknown [216.154.29.138]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DB8AE120315; Fri, 6 Aug 2021 00:07:07 -0400 (EDT) In-Reply-To: <87pmurs613.fsf@web.de> (Michael Heerdegen's message of "Fri, 06 Aug 2021 03:42:16 +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" Xref: news.gmane.io gmane.emacs.bugs:211288 Archived-At: > Yes, that's what I had in mind. Also for plain `pcase' I guess. > Maybe we could use an explicit (gv PLACE) pattern that is like SYMBOL > but compares/binds/sets the PLACE instead of the SYMBOL. I don't see how that would work. `pcase` is designed to test and extract data. It then makes that data available by giving it names (local variables). The SYMBOL pattern doesn't "set" that variable, it creates a fresh new one, but that operation doesn't exist for gv places (the only thing we can do there is get and set). It would make sense for `pcase-setq`, of course, but for `pcase` I just don't see how that would work (unless you'd want it to work like `cl-letf`, but that's like dynamically scoped let so I think you'd be hard pressed to find enough compelling use cases to justify it). Stefan