GNU bug report logs - #67611
[PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind`

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Sun, 3 Dec 2023 20:35:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 67611 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Okamsn <okamsn <at> protonmail.com>
Cc: 67611 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to
 `cl-destructuring-bind`
Date: Tue, 5 Dec 2023 09:26:58 +0000
On Tue, Dec 5, 2023 at 2:43 AM Okamsn via Bug reports for GNU Emacs,
the Swiss army knife of text editors <bug-gnu-emacs <at> gnu.org> 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ão




This bug report was last modified 146 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.