From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.bugs Subject: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind` Date: Tue, 16 Jan 2024 22:29:57 -0500 Message-ID: References: <277dd49a-e96d-4faf-a22e-aca952354a37@protonmail.com> <30f1bf76-1cf1-493e-be4f-38e405d0ecf6@protonmail.com> <875xzw4ngq.fsf@gmail.com> Reply-To: rms@gnu.org Content-Type: text/plain; charset=Utf-8 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37930"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67611@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=83=C2=A3o_?= =?UTF-8?Q?T=C3=83=C2=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 17 04:31:12 2024 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 1rPwe0-0009i8-9K for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Jan 2024 04:31:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rPwds-0000xo-B3; Tue, 16 Jan 2024 22:31:04 -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 1rPwdq-0000x7-JM for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 22:31:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rPwdp-0001Yp-Ke for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 22:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rPwdq-0000JB-Cs for bug-gnu-emacs@gnu.org; Tue, 16 Jan 2024 22:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Richard Stallman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2024 03:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67611 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67611-submit@debbugs.gnu.org id=B67611.170546220626796 (code B ref 67611); Wed, 17 Jan 2024 03:31:02 +0000 Original-Received: (at 67611) by debbugs.gnu.org; 17 Jan 2024 03:30:06 +0000 Original-Received: from localhost ([127.0.0.1]:50301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPwcw-0006xE-BI for submit@debbugs.gnu.org; Tue, 16 Jan 2024 22:30:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPwcu-0006lg-MN for 67611@debbugs.gnu.org; Tue, 16 Jan 2024 22:30:05 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rPwco-0000wK-KO; Tue, 16 Jan 2024 22:29:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Date:References:Subject:In-Reply-To:To:From: mime-version; bh=S9GqPm8eW4qwdYSXhLsmgngZjubJyFRc8cvn9lAs3Gw=; b=flYZXogeD2P0 Fb0eUqKj1MSiCTZZyhZKUgLNDm1tCwNTRRRu8PeLhAx2rmlvLc2wjnP/M5fgkh98wBm4YFYKy+Iyu jgQ16byOVjaV2wy2BmMaveKntbRU9zKcCh4BJ0K62T98NWuAxvGRvXFLusbrgPlBJVT64vZE9FH0a bBtKzRpXDnyADSsHHsC/gjZY53MOgbT+7xWiI+KNLH7I/WtrrkmTgh1uUr8FB0UueXNNNL9jSJoiV BQhb1yJoR7yp3eNnsji8j40yRBDFeZr43yPLvT73SS6BhwjXekmydKxQ5pl3kmGMg2jZ7kXEyJdB5 XkvNhXg2wF5tSNAWxNEg2g==; Original-Received: from rms by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1rPwcn-0004ln-Ml; Tue, 16 Jan 2024 22:29:57 -0500 In-Reply-To: <875xzw4ngq.fsf@gmail.com> (message from =?UTF-8?Q?Jo=C3=83=C2=A3o_?= =?UTF-8?Q?T=C3=83=C2=A1vora?= on Sun, 14 Jan 2024 03:12:53 +0000) 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:278372 Archived-At: [[[ To any NSA and FBI agents reading my email: please consider ]]] [[[ whether defending the US Constitution against all enemies, ]]] [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > Would someone please tell me what syntax is being proposed here, > > and show me an example, saying what it would mean? > Common-lisp style lambda lists. The ones containing the &key and > &optional with more features. Thanks for answering, but its meaning is not concretely clear to me. Could you tell me more concretely what this proposed feature would look like in use? Perhaps with an example including context? pcase does not use lambda lists, and neither does cond*. They are based on the backquote construct, which does not use &-keywords. I see a danger of conceptual incoherence here. If we want to extend the kinds of constructs for destructuring lists, we should extend the features of backquote. That would give a more coherent interface. We could define ,? to specify an element that might br missing, and ,& to specify a keyword argument. These could work in backquote for constructing lists as well as in destructiring. (let ((x 9) (y 10) (z nil) (u 11) (v nil) (w '(12 13))) `(a ,x ,?y ,?z ,&(foo u) ,&(bar v) . ,w)) => (a 9 10 foo 11 12 13) That is my first stab at the design. I think it is better, for this purpose, than using parmlist keywords. But maybe with more thinking we can find improvements. -- Dr Richard Stallman (https://stallman.org) Chief GNUisance of the GNU Project (https://gnu.org) Founder, Free Software Foundation (https://fsf.org) Internet Hall-of-Famer (https://internethalloffame.org)