unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo <akrl@sdf.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Inferred function types in the *Help* buffer
Date: Wed, 24 May 2023 12:19:06 +0000	[thread overview]
Message-ID: <xjf7csx2a85.fsf@ma.sdf.org> (raw)
In-Reply-To: <83o7manh0e.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 May 2023 13:46:57 +0300")

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	other threads:[~2023-05-24 12:19 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23 16:44 Inferred function types in the *Help* buffer Andrea Corallo
2023-05-24 10:46 ` Eli Zaretskii
2023-05-24 12:19   ` Andrea Corallo [this message]
2023-05-30 16:46     ` Andrea Corallo
2023-05-30 18:14       ` Mattias Engdegård
2023-05-30 18:48         ` Andrea Corallo
2023-05-31 12:19           ` Andrea Corallo
2023-05-31 14:08             ` Eli Zaretskii
2023-06-01 11:28             ` Mattias Engdegård
2023-06-01 11:35               ` Eli Zaretskii
2023-06-01 11:36                 ` Mattias Engdegård
2023-06-01 11:54                   ` Andrea Corallo
2023-06-01 11:50               ` Andrea Corallo
2023-06-01 13:06                 ` Mattias Engdegård
2023-06-01 13:34                   ` Andrea Corallo
2023-06-01 14:50                     ` Mattias Engdegård
2023-06-01 15:10                       ` Andrea Corallo
2023-06-01 17:53                         ` Mattias Engdegård
2023-06-01 19:13                           ` Andrea Corallo
2023-06-01 14:09                   ` Andrea Corallo
2023-05-31 13:46       ` Eli Zaretskii
2023-06-01  8:42         ` Andrea Corallo
2023-06-01  8:53           ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2023-05-23 16:47 Payas Relekar
2023-05-23 18:51 ` Philip Kaludercic
2023-05-24 12:20 ` Andrea Corallo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjf7csx2a85.fsf@ma.sdf.org \
    --to=akrl@sdf.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).