Subject: bug#71934: comp--spill-lap-function and closure (wad: bug#71934: 31.0.50; edebug--called-interactively-skip vs. new fun objects)

From: Andrea Corallo <[email-masked]>
Date: Sat, 06 Jul 2024 04:06:25 -0400

Eli Zaretskii <[email-masked]> writes:

>> From: Michael Heerdegen <[email-masked]>
>> Cc: Stefan Monnier <[email-masked]>,  Andrea Corallo
>>  <[email-masked]>,  Eli Zaretskii <[email-masked]>,  [email-masked]
>> Date: Sat, 06 Jul 2024 03:06:24 +0200
>> 
>> Alan Mackenzie <[email-masked]> writes:
>> 
>> > > > All very clever arguments, no doubt, but in the end it means you
>> > > > cannot native compile foo.
>> >
>> > > To obey the docstring, ....
>> >
>> > Forget that doc string, just do what is right, expected, and convenient
>> > for Emacs users, and adjust the doc string afterwards.
>> 
>> We are actually trying to do that, but we don't understand the code
>> because of the lacking or wrong documentation.
>
> I don't understand this difficulty.  Andrea, who wrote that function
> (and everything around it) is here, and is very helpful.  How come
> this lack of understanding, let alone lack of documentation, is still
> with us?

Must say I'm really lost in this thread.

First I don't understand the functionality that got lost.

Second the method "comp-spill-lap-function ((form list))" never served the
case (native-compile 'foo) but rather (native-compile '(lambda () 3)).

(Now if the form (closure () 3) does not exist in elisp as valid form
this might translate in 1 line fix in 'comp-spill-lap-function ((form
list))' but let discuss this aside and is not about a lost
functionality).

(native-compile 'foo) is served by 'comp--spill-lap-function ((function-name symbol))'.

Also:

(native-compile 'foo) works (as always did) and even what Alan added
(native compiling lambdas in function native compiled by symbol name)
that is:

(defun foo () "foo doc string"
       (lambda () "lambda doc string" 3))

(subr-native-elisp-p (funcall (native-compile 'foo)))

Still works for me on master.

So I must be really missing something in this discussion.

Let us please stick to exactly what worked in which version and what
does not in which other version, if we identify a case will be easy to
fix.

And even more importantly, I'll make sure we have a test that covers
that case so we can't have any other regression (assuming we had one).

Thanks

  Andrea