emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inferred function types in the *Help* buffer


From: Andrea Corallo
Subject: Re: Inferred function types in the *Help* buffer
Date: Wed, 24 May 2023 12:19:06 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Date: Tue, 23 May 2023 16:44:08 +0000
>> 
>> foo is a native-compiled Lisp function in
>> ‘~/.emacs.d/eln-cache/30.0.50-e29d76eb/test-a526a80f-5481bc95.eln’.
>
> Why does it name the .eln file, not its source .el file?  Or is this
> the case when there's no .el file?

I believe we show the .eln when this is loaded directly like (load
"xxx.eln"), IOW when we have no information on the original source.

>> Signature: (foo N)
>> 
>> Inferred type: (function (t) (or (member to-small too-big) (integer
>> 100 100)))
>
> Can you explain what is this "Inferred type" information about?

Sure, the native compiler in the attempt of optimizing the code is
propagating value type informations over the code being compiled.

The inferred type is formed using the arglist of the function (ATM is
not possible to specify types for arguments so they are all of type t)
and the return type.  The return type is nothing more than the union of
all types inferred by the compiler at the various return point of the
function.

At the time I wrote something about this here
<https://akrl.sdf.org/gccemacs.html#orge596749>.

Also for more about CL type specifiers
<https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node44.html>.

>> ATM I adds as well "Signature: " in front of the signature to
>> differentiate it from the type.  But looking at it in restrospective it
>> might be not even necessary.
>
> We should probably preserve the current format of just showing the
> signature without any headings.

Agreed.

Thanks

  Andrea



reply via email to

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