Subject: Re: bug#65017: 29.1; Byte compiler interaction with cl-lib function objects, removes symbol-function

From: Stefan Monnier <[email-masked]>
Date: Sat, 05 Aug 2023 18:58:00 -0400

>> internal-macroexpand-for-load isn't being called in the context of a
>> byte compilation.  It might create a symbol with position which wrongly
>> matches, or fails to match, another symbol.  This is what has happened
>> in this bug.
>
> If internal-macroexpand-for-load is "verboten" from being called by
> the byte-compiler, I'd expect an assertion in it to that effect.

It's not "verboten".  Removing the binding just says that if you want to
pass adorned code to that function, it's the caller's responsability to
let-bind the variable around the call.

> Because someone, some day, might easily forget and call that function
> in the byte-compiler.

The byte-compiler already let-binds that variables, so it won't be a problem.

> Btw, why was this binding added there to begin with?

IIUC it took some trial and error to get to understand where that var
needs to be bound (as well as where is the right spot to strip the
sympos), and this is just one binding that was never removed after we
found a better place for it.

        Stefan