emacs-devel
[Top][All Lists]
Advanced

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

Re: A combination of defmacro, functionp, and quoted lambdas yields diff


From: Stefan Monnier
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Sat, 17 Feb 2018 16:58:39 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> We recently ran into a problem in Flycheck that confused us.
> Evaluating the following twice yields different results on the first
> evaluation (nil) and on the subsequent ones (t):
>
> ;; nil on the first run; t on subsequent ones
> (progn
>   (defmacro m (f)
>     `(function ,f))
>   (functionp (m (lambda ()))))

Depends what you mean by "evaluating".  At top-level macroexpansion is
supposed to be careful to handle the above correctly (i.e. to evaluate
the defmacro) before performing the macro-expansion of the (functionp ...).
But for that we had to add ad-hoc code both to the byte-compiler and to
the lread.c code that does the eager-macroexpansion of non-compiled files.

So, how do you "evaluate" the above code in order to see this problem?


        Stefan




reply via email to

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