From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind` Date: Tue, 5 Dec 2023 09:26:58 +0000 Message-ID: References: <277dd49a-e96d-4faf-a22e-aca952354a37@protonmail.com> <56ebae03-a94d-4379-bd08-66bde2311bb7@protonmail.com> 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="610"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67611@debbugs.gnu.org, Stefan Monnier To: Okamsn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 05 10:28:07 2023 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 1rARip-000ATN-3Q for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Dec 2023 10:28:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rARif-0000cX-CM; Tue, 05 Dec 2023 04:27:57 -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 1rARiZ-0000cA-3A for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:27:52 -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 1rARiY-00069D-RM for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:27:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rARij-0002sL-Rm for bug-gnu-emacs@gnu.org; Tue, 05 Dec 2023 04:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Dec 2023 09:28:01 +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.170176844911000 (code B ref 67611); Tue, 05 Dec 2023 09:28:01 +0000 Original-Received: (at 67611) by debbugs.gnu.org; 5 Dec 2023 09:27:29 +0000 Original-Received: from localhost ([127.0.0.1]:36637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rARiD-0002rM-92 for submit@debbugs.gnu.org; Tue, 05 Dec 2023 04:27:29 -0500 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:50661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rARiA-0002r8-OJ for 67611@debbugs.gnu.org; Tue, 05 Dec 2023 04:27:27 -0500 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50bfe99b6edso1523487e87.1 for <67611@debbugs.gnu.org>; Tue, 05 Dec 2023 01:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701768430; x=1702373230; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=s7tV9wJSs6AZ49KWyX7b6XWERlciLouG8uV+BYndsfM=; b=cR7LJ0/mUWF7U+wDCK1nRHj2bxvz84fldidMg00w8vGZQ3kZKOAIfDMHJIrCoarkMe 1hObqCp3qm6wUqPbshkbKEdTqJHxcnAgODEITO1eJKRA4Gh1Vo7+Lz71F/q0Bq56BdGN jzWQqz2X7tSUrvcZXfj6icHJ6Q75i/vx5IGWvMp0UGb5ayJKdz5F6UWv5t2ezTZV3pQG W8qppU/dNrp/zqKXMjd5C3AajzAPNC5hTo6BvLvtZDEdAwG+fTRaLHaMwBp4B4vw5q6K Lzucz/MNCWuLn9R1dfth2+1v1PxVXfLPUPIIe/qld2ZYWvPIa6YcW1aiwslocFrUOpSc J3Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701768430; x=1702373230; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s7tV9wJSs6AZ49KWyX7b6XWERlciLouG8uV+BYndsfM=; b=mtqG8RhxF40roBdGJwAE/xCsyOQ3NvTFcaP2n9g8kYzfbBdLsxDgmPOmAd7bpLGnwa 2DvNIhcBK/zpyzzQioCjRHfTagiJJLBzgkT79aR+RRavMFXO6crwX/UNggkJlsbVh87X 0w8+wKddAgi+ZrsIO4YiIHZSkp4KYJmqu7nSi0mPkqbPxQqR/NXjqKzkLJDYFDPpCuaz pp7XytJhdek6i4oyE80r/3TKVUKocZWsHtrz9L5WPajlDqqZs84AFEd6raUvDf0NS2xu CrCRA2/MXc2zWzjiVdc4ssZ/NuUC6oZZsSg/y6HS9o/MGqCGH4549r923s73X3diuKTz ebuQ== X-Gm-Message-State: AOJu0YzDU2ZXS3VpMYeeNk9TmGrcwdYiT4K4QKNGjGIdCUBH9VlOF02S e8h+nY8Tslk+aAgYVZYMKi5hknjfMppX9f6AjLB+MqJY2Y4= X-Google-Smtp-Source: AGHT+IELW38zTzyTbYXUzERwnCEHw3INUBaxZtBl/yzvXauMKz0UPjhRrzjCHd3PIoBi6AH8r85gi7AIE+WluBVFHg4= X-Received: by 2002:ac2:4e51:0:b0:50b:fa93:35c9 with SMTP id f17-20020ac24e51000000b0050bfa9335c9mr957733lfr.113.1701768429612; Tue, 05 Dec 2023 01:27:09 -0800 (PST) In-Reply-To: <56ebae03-a94d-4379-bd08-66bde2311bb7@protonmail.com> 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:275561 Archived-At: On Tue, Dec 5, 2023 at 2:43=E2=80=AFAM Okamsn via Bug reports for GNU Emacs= , the Swiss army knife of text editors wrote: > For me, I am interested in using such a destructuring pattern with > `pcase-let` and `pcase-setq`, but not so much with `pcase` itself. > > > Maybe we could introduce a different Pcase pattern which covers those > > needs but stays closer to the Pcase pattern syntax? > > As far as I understand Pcase, one thing that I think cl-lib does better > is specifying default values for multiple optional variables. For > example, for `(a &optional (b 2) (c 3))` in Pcase, I would write Yes. cl-lib has a couple of neat tricks up its sleeve, still. And what about keyword arguments in plists? Can pcase destructure them? If so, does it bind the "supplied-p" variable? And can it rename the variable being destructured to something else non-clashing? All these things are useful in CL's destructuring-bind, but it is missing other stuff like "casing" logic. So at least on a first glimpse, this reunion would be welcome by me. With the caveat that I haven't seen any examples or the patch yet, and it matters. Jo=C3=A3o