GNU bug report logs - #50136
28.0.50; A problem with rx-let expansion

Previous Next

Package: emacs;

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

Date: Fri, 20 Aug 2021 14:01:01 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 50136 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca
Subject: bug#50136: 28.0.50; A problem with rx-let expansion
Date: Sat, 21 Aug 2021 13:45:45 +0200
Mattias Engdegård <mattiase <at> acm.org> writes:

> Yes. It was (and is) a trade-off between the simpler "template-like"
> semantics currently used and the programmatic "execute code" semantics
> of Lisp macros. The idea was that the simpler semantics would be
> simpler and sufficient for most uses, and `eval` forms could always be
> employed in other cases.

Ah ok, now my picture gets somewhat clearer.  The semantics I wish for
are already possible.  I need to use `eval' on the one side, and &rest
on the other.  Since REST from &rest rest is spliced in, I can't use
REST like a variable (and e.g. test whether any args have been provided,
that is impossible, since in that case it expands to nothing); instead I
can use something like

  (let ((args (list rest))) ...)

inside rx `eval' and use that as argument list variable.

I think I can live with that.

Maybe it would be good to improve the docstring to say the things that I
missed clearer? - Say explicitly that this mechanism is different from
macros, instead it's just a simple substitution mechanism, and add a
simple example to the docstring as a reference, even if we already have
examples in the manual.

Maybe also tell that using `eval' you can still have a macro-like
behavior in the end.

Michael.




This bug report was last modified 3 years and 273 days ago.

Previous Next


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