From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Inferred function types in the *Help* buffer Date: Wed, 24 May 2023 12:19:06 +0000 Message-ID: References: <83o7manh0e.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7942"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 24 14:20:05 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q1nTI-0001oT-HC for ged-emacs-devel@m.gmane-mx.org; Wed, 24 May 2023 14:20:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1nSR-0001ye-9t; Wed, 24 May 2023 08:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1nSQ-0001yW-2J for emacs-devel@gnu.org; Wed, 24 May 2023 08:19:10 -0400 Original-Received: from ma.sdf.org ([205.166.94.33]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1nSO-0007mt-5m; Wed, 24 May 2023 08:19:09 -0400 Original-Received: from akrl by ma.sdf.org with local (Exim 4.92) (envelope-from ) id 1q1nSM-0001yu-E9; Wed, 24 May 2023 12:19:06 +0000 In-Reply-To: <83o7manh0e.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 24 May 2023 13:46:57 +0300") Received-SPF: pass client-ip=205.166.94.33; envelope-from=akrl@sdf.org; helo=ma.sdf.org X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_XBL=0.375, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306297 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Date: Tue, 23 May 2023 16:44:08 +0000 >>=20 >> foo is a native-compiled Lisp function in >> =E2=80=98~/.emacs.d/eln-cache/30.0.50-e29d76eb/test-a526a80f-5481bc95.el= n=E2=80=99. > > 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) >>=20 >> 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 . Also for more about CL type specifiers . >> 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