Subject: Re: 28.0.50; A problem with rx-let expansion

From: Michael Heerdegen <[email-masked]>
Date: Sat, 21 Aug 2021 13:45:45 +0200

Mattias Engdegård <[email-masked]> 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.