Subject: bug#72754: 31.0.50; Add a pcase-pattern-let?

From: Michael Heerdegen <[email-masked]>
Date: Sat, 24 Aug 2024 07:56:44 +0200

Stefan Monnier <[email-masked]> writes:

> > wouldn't it be a significant improvement and maybe a low hanging fruit
> > to add a macro allowing to add local pattern definitions?  I.e., like
> > `macrolet' by for pcase patterns?
>
> I don't know how important/useful it would be, but yes it would make
> a lot of sense.  As a matter of fact, it's a general pattern which
> recurs in all the packages which provide an extensible domain specific
> language (peg.el, pcase.el, bindat.el, rx.el, gv.el, ...) and I'd like
> to find a general solution.

Makes sense, we could then also implement the dynamical docstring
generation for all of these in a general way.  As whole it's a bigger
project, though.

> It can also make sense to allow defining a set of extensions at one
> place, and then make them available locally.

Absolutely.

If you want to give it a try, I'm here...

Michael.