emacs-devel
[Top][All Lists]
Advanced

[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: Stefan Monnier
Subject: Re: Why is FUNC in cl-callf not allowed to be an expression?
Date: Fri, 24 May 2019 11:29:37 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> I would like to speak that out somewhere because it's not obvious, and

Agreed.

> also explicitly for local macros (because the current docstring saying

I don't see them as any different, but clearly some users don't see it
this way, so we can put a reminder there, indeed.

> Can we say that macros are "expanded in the global environment", or

Sounds good.

> 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
> macros?).

Something like it, yes (using "refer" can be tricky because they can
emit code which then refers to it, and this can be seen as "the macro
refers to" even though technically it's different).

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

In macros.texi (@node Compiling Macros) as well as in loading.texi
(@cindex eager macro expansion) we allude to when macros are expanded,
but I think we should be more upfront about it somewhere.

A separate @node about when macro expansion can take place and what
environment it can rely on would be welcome.


        Stefan




reply via email to

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