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: Mon, 26 Feb 2018 12:38:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> | (test-macro
>> |   #[0 #1="byte code..."
>> |       [(lambda nil
>> |          (let
>> |              ((out
>> |                (mmm
>> |                 #'(lambda nil nil))))
>> |            (message "with-eval-after-load: %S" out)))
>> |       ...]
>> |       11])
>
> Right, I think that's broken.

Yes, at that time it's already too late.

>> Maybe you can change `mmm' so that it handles both of these cases as you
>> want?
> We're considering this for Flycheck, yup :)

That won't help the case where the code was compiled.  You really need
to think in terms of compilation: people generally don't have a clear
idea of when macroexpansion takes place for interpreted code, whereas
it's clearer in the case the code is compiled.

> Mostly though, I'd like to understand where the issue comes from (my current
> understanding is that it's a miscompilation), and whether it can be fixed.

That's right, it gets miscompiled because the compiler isn't told about
the `mmm` macro beforehand so it presumes that it's an unknown function.


        Stefan



reply via email to

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