[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-des
From: |
João Távora |
Subject: |
bug#67611: [PATCH] Add a Pcase pattern `cl-lambda` equivalent to `cl-destructuring-bind` |
Date: |
Tue, 5 Dec 2023 09:21:47 +0000 |
On Mon, Dec 4, 2023 at 7:09 PM Stefan Monnier via Bug reports for GNU
Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org>
wrote:
>
> > The attached patch adds the pattern `cl-lambda` for Pcase, which works
> > like `cl-destructuring-bind`. There are two differences with the lambda
> > lists:
>
> Hmm... I'm not sure mixing the CL destructuring patterns with the Pcase
> patterns (both of which are rather featureful and complex) will help
> their popularity.
>
> Beside that problem (which means I'm not very favorable to the
> addition), the name should be changed because "lambda" is misleading.
> It suggests this has to do with a function (I had to read the code to
> understand what this is doing).
>
> > The pattern is useful when one wants to combine the features of `pcase`
> > and `cl-destructuring-bind`, such combining the optional values with the
> > `pred` or `guard` patterns.
>
> Do you have examples uses?
I for one would like to see some examples too. Okamsn's description
of this pcase extension sounds interesting. In fact, it sounds very
much like the slime-dcase and sly-dcase macros in SLIME and SLY
respectively.
João