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#49809: [PATCH] Add macro 'pcase-setq' Date: Thu, 12 Aug 2021 08:13:36 +0200 Message-ID: <87wnor5gxb.fsf@web.de> References: <07ad5892-3343-4c35-00e3-9753bca5f67b@protonmail.com> <87eeb6dmvo.fsf@web.de> <87czqjod9y.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8744"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: okamsn@protonmail.com, 49809@debbugs.gnu.org, monnier@iro.umontreal.ca To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 12 08:14:20 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 1mE3yt-000212-Uv for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 08:14:19 +0200 Original-Received: from localhost ([::1]:48984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mE3yn-0002M3-Ns for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Aug 2021 02:14:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mE3ye-0002IS-8J for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 02:14:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mE3yc-0002Wf-Aa for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 02:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mE3yc-0002Xk-6c for bug-gnu-emacs@gnu.org; Thu, 12 Aug 2021 02:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Aug 2021 06:14:02 +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.16287488329750 (code B ref 49809); Thu, 12 Aug 2021 06:14:02 +0000 Original-Received: (at 49809) by debbugs.gnu.org; 12 Aug 2021 06:13:52 +0000 Original-Received: from localhost ([127.0.0.1]:37182 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE3yS-0002XC-8X for submit@debbugs.gnu.org; Thu, 12 Aug 2021 02:13:52 -0400 Original-Received: from mout.web.de ([212.227.15.14]:35287) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE3yQ-0002Wx-DQ for 49809@debbugs.gnu.org; Thu, 12 Aug 2021 02:13:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1628748820; bh=chx+q9LzI/mQUho84YgthjV+ivr4tIoNH+TiiU35jgg=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=pgiVdg7kKZKtO6LIUUcbMCI17uiTv3SF5uu2uQ/JEz91mF9xBy6AX1+0FpodBjVWY QZxKZd1a+wlujLZp4lKNv9HhGIpnIFMrqMM5Kj+9AMy7XbfuvcOwIZHwQ7etA93L6Z vTBTm6t2qWDwkMozn5Mj+vutEF8W3TjeQI0eT4Ao= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb004 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MRA59-1mgPZE3evP-00UYYL; Thu, 12 Aug 2021 08:13:39 +0200 In-Reply-To: <87czqjod9y.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 11 Aug 2021 23:57:29 +0200") X-Provags-ID: V03:K1:sp+oAxbRUdY71HwYuQ6Ui6R3YrUqMOoaU0UMWlyLULzyvyURfbo W1Vkx/lPiUKLxXJDQyK2jlASu5UwpbdtTsWoozgBLtbeQP7R0NhOdvq2v7lgJFt1ivQZO8f 1JtRb4wiTB+dCnG2LcyBO1RvMUp9fTTNJzw0irsDLGml0Tuwk4cWYA1oTcHZ3Xbb9ZGr4Os Us7VS5stlPUM233HyWVLg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1Teqn78xrO0=:LYwLfp6i9jtOlHdJeyTnVd fCKL1F5ZDO2cBsKVjM+u4amnBfuPVdRkETAQNelK7YhzRFbKJn5EgKYjl7e0BZaIkJW5Jo67N Zg3bj6yanmwCFKM9GC3vPVrzZQd5Q9FXMgYph8WB/vceYGFKnEOWhotpzxswK0NsOXHszm5Th YIBqFyxonwxsQDYLFRnykOB2/mRf+06AsnV/aHT8svmOG9YoEWtWH48V4xg3e7eZfKwQLSvKA SJQZMV/QOGJcAV/VS1YbGtyFzyc3Y+V4AypwFz+FMhpmQu2PpXlSXP6Ve7f98CL6IyZ0VKecT w7I9Gx8+gjXWd5fiXE7J1QhBm/yVd5XtdPeiV1EK5kKhQrblmh592rWwoY9jqWeG5tZdCBKkE /DP+QmivlgGLBmLKvfW9sNdPdeBOsFw0mjC9+zuEgPkUMZ65aN/l4AqYv4VTaJVOl9pObcb/X ftcGqLUHZLsLqJqBXVclFy9hbcpF6qqkrzJIv6Kc4pVi5uUEehxf+4RfKrBtua04SmBo3NWBm DkESAVplC4EcvtgjgVNKLx37S5LS3MGmtEXBLaT2xBIDecHVLUOAa0zYtoXFx4cX/o/fW9/9h d14BBQ40M8Rt5PtM4KpRJ512OxaqxVjTVTIEgAUyOU41sRJxq1IX/GRXhZ5MQxFyfspr76fNy +aIhI9NX67HKjg3kM4cbD5UcMXGzXQKvfQLpQJdbtUWZb2nzT754+WTpcVxXt5jZQLPGiqW1X jdZHgRCGTsZkMQfByzjTEC4MFM4caXnGLW/LvoJxOmJUeuJVyr4fEPi84Nky1wLkDNswkWRW 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:211640 Archived-At: Lars Ingebrigtsen writes: > > But Michael points out that it seems your code won't perform the > > assignment if the pattern doesn't match, which I find to be an > > odd behavior. I hope that this is even true in all cases. > > I'd expect a behavior like that of `pcase-let`, instead. > > ... because I have no opinion here, really -- behaving like `pcase-let' > would be good, but on the other hand, the current behaviour also kinda > sorta makes sense. Here is something else that is odd: (let ((a 17) (b 17) (x 17)) (pcase-setq (or `((,a) [(,b)]) x) '((1) [(2)])) (list a b x)) ;; ==> (1 2 nil) The first `or' branch matches, nevertheless is the binding of `x' being set to (a totally unrelated value) nil which doesn't make much sense. Michael.