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

From: Stefan Monnier <[email-masked]>
Date: Thu, 03 Aug 2023 12:41:55 -0400

> cl--label-convert is defined as "Special macro-expander to rename
> (function F) references in `cl-labels'.".  What does "rename (function
> F) references" mean?  Is the term "name" in this context defined
> anywhere?

`cl--label-convert` is the macro expander for (function F) used inside
`cl-labels` so that

    (cl-labels ((my-foo () toto))
      #'my-foo)

gets turned into

    (let ((bar (lambda () toto)))
      bar)

So it "renames" (function my-foo) to the corresponding variable `bar`.

But for most (function BLA) the code should be left as-is, which a macro
can't do directly, so `cl--labels-convert-cache` is a hack which lets us
receive a handle to the overall (function BLA) form so we can return it
as-is rather than having to rebuild a *new* (function BLA) which would
just make the macro-expander call us right-back.

>> Making Ffuncall (etc) tolerant of symbol-with-pos isn't appealing
>> either.
> Definitely not!

I think we all agree on that.

        Stefan