From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Adam Porter Newsgroups: gmane.emacs.devel Subject: Re: Declaring Lisp function types Date: Fri, 15 Mar 2024 19:01:44 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17185"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: eliz@gnu.org, emacs-devel@gnu.org, stefankangas@gmail.com To: acorallo@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 16 01:02:49 2024 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 1rlHVg-0004H3-N3 for ged-emacs-devel@m.gmane-mx.org; Sat, 16 Mar 2024 01:02:49 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlHUt-0005Iw-TI; Fri, 15 Mar 2024 20:02:00 -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 1rlHUn-0005Ih-TF for emacs-devel@gnu.org; Fri, 15 Mar 2024 20:01:54 -0400 Original-Received: from quail.birch.relay.mailchannels.net ([23.83.209.151]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlHUl-0004qe-Bg; Fri, 15 Mar 2024 20:01:52 -0400 X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 44B60901E43; Sat, 16 Mar 2024 00:01:47 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a277.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id B3B12901DEF; Sat, 16 Mar 2024 00:01:46 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1710547306; a=rsa-sha256; cv=none; b=q3pZgXbsxIxqm2L0R3fm9P9QWxG1ftuAVTUb/DNzuo7A3A7ng9hCiCtmFtq8i7ZrMOO/Cj KqhPPsJoNHyJ5AbKbdzoDmIKI8gFVWQdtajtr6nhaCPHZbhK0FWGy3D5TnPaV15XNupRQX /0bh6UBD2y3ugqxzVjh6Gmld+FLkbIpsY6Z5esKR/0a/NjZ4JKOAuhYhET0cEc3oAezA0d /MjOwRDj8GBAH9/zMgAHJJQEOAPnZOTNyxdJ4dTWphve8X1KVSCe2MQl1IqMyHqQwSPKtZ CMYoGzBBmAzQR2IJEDDk37b/9ShKNnt38frJQDvsmN+phQo/+tRA/1rxW3/tuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1710547306; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=qCQGMI+G1w288IWMaBhmUhjlYQyOiutk1xW5Lzsv7Mk=; b=foPbIE4tCRwD/P7xOklyGSl9hwn6lrjsGiEGITaQgpDvMN4V/AjnZmlaWMdxsSgnqlqcRj uVW2O0KRreyTOcByrN4d4hVaql9lei25iwIcR7qY2ZQ+eE9Ube0ruJbtcV+wzl8rug9cmQ edbXAOKPhWCU/KjnAVrGoaxF4G8BuVQBiJOwW3c21quBc85GOdLO1QbXo/ou3m06dGNdce mUCgYTWI3FXqOI3P7JXVIkSGYjPACxFLAu1YRBZsN1eqS2q/CwgQxuwamqoemNWkL0C8QF bQz5UOsG/FZpIZBacasfwIhKMSPf5xEEzYsDZVkMFULY21kB3Yy+xSRzJ+L8ug== ARC-Authentication-Results: i=1; rspamd-b46fcdc5-6n9vx; auth=pass smtp.auth=dreamhost smtp.mailfrom=adam@alphapapa.net X-Sender-Id: dreamhost|x-authsender|adam@alphapapa.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|adam@alphapapa.net X-MailChannels-Auth-Id: dreamhost X-Grain-Illustrious: 178c9b576b5c8b47_1710547307123_2525234622 X-MC-Loop-Signature: 1710547307123:1546590158 X-MC-Ingress-Time: 1710547307123 Original-Received: from pdx1-sub0-mail-a277.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.126.173.87 (trex/6.9.2); Sat, 16 Mar 2024 00:01:47 +0000 Original-Received: from [10.43.0.18] (unknown [193.56.116.15]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: adam@alphapapa.net) by pdx1-sub0-mail-a277.dreamhost.com (Postfix) with ESMTPSA id 4TxLrT5R2xzHl; Fri, 15 Mar 2024 17:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1710547306; bh=qCQGMI+G1w288IWMaBhmUhjlYQyOiutk1xW5Lzsv7Mk=; h=Date:To:Cc:Subject:From:Content-Type:Content-Transfer-Encoding; b=BfM6tW3yb0dPO+uiRtzKhdQq4dHlzG5jPIgIEZHioIveF1ax4NiN7fmyQNylEg1VW tAJ9lkQW/xNEBpg/APdxlVGWh7oNzMYAVjXV/VL3DA4cuSf11uMNtXbfGioLBIJkNt Veyef/bBg7LR8T8pPpGp3libOy8Zzi27f+svR23tI0G4UlB8puU5a6yT6coVFAGA+k gnuB2n2HCeGqooYTXpL4mSYAdUldBlRaRBUdinsGAjH1Fs/xplT+g7eerjhdv4Dktg K1RwViW95wREZAQBMTWl9UTVcgWHqSiPh59oe5dAM7lQJdOVHltHX34vxKat5nrykL NdrhUVBN+yq2g== Content-Language: en-US In-Reply-To: Received-SPF: neutral client-ip=23.83.209.151; envelope-from=adam@alphapapa.net; helo=quail.birch.relay.mailchannels.net X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, 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:317093 Archived-At: Hi Andrea, et al, > I'd like to progress on this but in order to do that we should pick a > syntax. > > Of the three most discussed syntaxes in this thread my order of > preference is (by examples): > > 1: > > (defun sum (a b) > (declare (function (integer integer) integer)) > (+ a b)) Please do not use this syntax. As I've said on the list at and , and in this bug report , and again on the list in this separate thread, as I was instructed , that would preclude the possibility of allowing DECLARE-FUNCTION forms to be placed inside DEFUNs' DECLARE forms as: (declare (function ...)) For some reason, I can't seem to get a response to that idea, either affirmative, negative, or neutral. But I would ask that my proposal at least be considered and addressed before moving forward with that syntax for this other purpose. > 2: > > (defun sum (a b) > (declare (type (function (integer integer) integer))) > (+ a b)) > > 3: > > (defun sum (a b) > (declare (type (integer integer) integer)) > (+ a b)) > > For the reasons I've already expressed: 1 I like it, 2 I'm okay with it, > 3 I very much dislike it. Forgive me if I've missed it, but why do you dislike #3? It seems concise and descriptive: it is DECLAREing the DEFUN's TYPEs, just as: (declare (debug ...)) DECLAREs the DEFUN's DEBUG instrumentation. Whereas including "function" in the form seems redundant and occupies several extra characters. The DECLARE form is specifically about the DEFUN, so what other TYPEs would it be about? Thanks, Adam