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: Thu, 01 Jun 2023 11:10:56 -0400 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="10441"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Andrea Corallo , Eli Zaretskii , emacs-devel To: Mattias =?utf-8?Q?Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jun 01 17:11:42 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 1q4jxm-0002Xh-E0 for ged-emacs-devel@m.gmane-mx.org; Thu, 01 Jun 2023 17:11:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4jx5-0007bf-Gw; Thu, 01 Jun 2023 11:10:59 -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 1q4jx3-0007bL-BZ for emacs-devel@gnu.org; Thu, 01 Jun 2023 11:10:57 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4jx2-0000Eu-Lh; Thu, 01 Jun 2023 11:10:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=7on4niRhaOTJoDc6aDzX9CPf+CofCflm4t2Ih9wlYX4=; b=GXB0CmHw1Oa9KPI//hWw 9j8QzpJ5MVe2kfcyuQuquGYq3xU329svPfpN3T20FHcR2GpBUI44iMV5a8pRsXQ3CoxHM/Jb0z0Hb w+H1203EHedOckwGg+3OqMhPhGqddsxv/KjZiMpdRvQJrt37ruZepQ/SNIBOHjfCmyNGxFCO2KcNM f8aviI3eQHTlCLdPKVzzE/pETInF9opOpC/OZQUmsaQZUuqeWZO5Do1dPIzhJMCiAclAp4L5P6lmO x1wYSiA59Aj4o9XGvce56/4Qzzr0U/8PNfg7efV27sTANG8353MCX7AOV7NE/pMIUSBcJRdVUGqaa hfrSt52uETq57w==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1q4jx2-0000az-At; Thu, 01 Jun 2023 11:10:56 -0400 In-Reply-To: ("Mattias =?utf-8?Q?Engdeg=C3=A5rd=22's?= message of "Thu, 1 Jun 2023 16:50:40 +0200") 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:306516 Archived-At: Mattias Engdeg=C3=A5rd writes: > 1 juni 2023 kl. 15.34 skrev Andrea Corallo : > >> Are you suggesting we need some kind of override method for this? > > Maybe. It depends on what the purpose of showing the type in the help tes= t is in the first place. It's just a very concise and effective way to express the input/output value/types of the function. I, for one, find it very useful. >> Again, if you've found these to be incorrect that's a bug we already >> have in the code in use. They had to be reported/looked into since >> probably the time we noticed this inchoerence for the first time. > > Sorry, I originally assumed that I had misunderstood what the types > meant and how they were used by the native compiler. After all, I > cannot take it for granted that internals of code found elsewhere > should be neatly arranged for my own purposes. > >> Aren't the entries we have in agreement with the docstring? If the >> docstring is not in sync with the implementation we have either to fix >> one o the other I think. > > It's a policy problem: either we trust handlers to be implemented to > spec or we distrust them just to be on the safe side. Normally we > assume that users follow documented rules or suffer the consequences, > but in this case it may not be the same user who writes the handler > and who calls the function, so it may be fairer to shield the caller > by normalising the return value of all handlers in these and other > cases. If we distrust the handler either we should coerce the value to boolean before returning it or either we should change the docstring. >> - (coordinates-in-window-p (function (cons window) boolean)) >> + (coordinates-in-window-p (function (cons window) (or cons (member b= ottom-divider right-divider mode-line header-line tab-lineleft-fringeright-= fringevertical-line left-margin right-margin)))) > > Typos here (and null is missing). Thanks >> - (framep (function (t) boolean)) >> + (framep (function (t) (or boolean (member x w32 ns pc pgtk haiku)))) > > This may be too fragile. Next port won't find this place to add its name. > > Of course, if we manage to put these type declarations near the function = definitions then accuracy would likely be better and maintenance easier (an= d more likely to take place at all). Yeah that's the general argument for that. As metioned I guess this should be a temporal solution anyway. BTW I believe that most likely the next port value will be to added to comp-known-type-specifiers only if we expose it into the help :) Thanks Andrea