GNU bug report logs - #72754
31.0.50; Add a pcase-pattern-let?

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Thu, 22 Aug 2024 02:03:01 UTC

Severity: normal

Found in version 31.0.50

To reply to this bug, email your comments to 72754 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org:
bug#72754; Package emacs. (Thu, 22 Aug 2024 02:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Michael Heerdegen <michael_heerdegen <at> web.de>:
New bug report received and forwarded. Copy sent to monnier <at> iro.umontreal.ca, bug-gnu-emacs <at> gnu.org. (Thu, 22 Aug 2024 02:03:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; Add a pcase-pattern-let?
Date: Thu, 22 Aug 2024 04:02:05 +0200
Hello,

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?

It could help to make larger patterns better readable, by factoring out
long or repeatedly appearing patterns and giving them meaningful names.
Without cluttering the global namespace.

Maybe an implementation could be similar and as simple as that of
`rx-let'?


TIA,

Michael.






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72754; Package emacs. (Thu, 22 Aug 2024 13:40:01 GMT) Full text and rfc822 format available.

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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 72754 <at> debbugs.gnu.org
Subject: Re: bug#72754: 31.0.50; Add a pcase-pattern-let?
Date: Thu, 22 Aug 2024 09:38:04 -0400
> 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.

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


        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72754; Package emacs. (Sat, 24 Aug 2024 05:57:01 GMT) Full text and rfc822 format available.

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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 72754 <at> debbugs.gnu.org
Subject: Re: bug#72754: 31.0.50; Add a pcase-pattern-let?
Date: Sat, 24 Aug 2024 07:56:44 +0200
Stefan Monnier <monnier <at> iro.umontreal.ca> 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.




This bug report was last modified 294 days ago.

Previous Next


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