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: Clément Pit-Claudel
Subject: Re: A combination of defmacro, functionp, and quoted lambdas yields different results on consecutive evaluations
Date: Sun, 18 Feb 2018 10:17:57 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-02-17 16:58, Stefan Monnier wrote:
>> 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?

Using C-M-x, or just by putting it in my .emacs.




reply via email to

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