[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is FUNC in cl-callf not allowed to be an expression?

From: Michael Heerdegen
Subject: Re: Why is FUNC in cl-callf not allowed to be an expression?
Date: Fri, 24 May 2019 01:38:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

> Macros can be expanded at any time before executing the code, so indeed
> they can't reliably make use of variables bound in the code surrounding
> the macro call.  Whether they're local or global macros makes no
> difference in this respect.

I would like to speak that out somewhere because it's not obvious, and
also explicitly for local macros (because the current docstring saying
"This is like `cl-flet'[...]" somehow made me think that they might be
different from global macros in this regard).

Can we say that macros are "expanded in the global environment", or
should we just say that the expander functions are not allowed to refer
to local variables (though, that would still leave some questions open,
e.g. what about local (flet-bound) local functions or other local

My patch spoke about when these macros are expanded because of such
subtleties, I thought it could be better to imagine with that wording.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]