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: Sun, 25 Feb 2024 01:35:45 -0600 Message-ID: References: <86v86ez6af.fsf@gnu.org> <3cc20ab3-fee7-4b96-9296-604239d761ad@alphapapa.net> <86edd2yy9g.fsf@gnu.org> 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="12204"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: acorallo@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 25 08:36:36 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 1re93r-0002rn-BO for ged-emacs-devel@m.gmane-mx.org; Sun, 25 Feb 2024 08:36:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1re93J-0001Er-Fd; Sun, 25 Feb 2024 02:36:01 -0500 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 1re93F-0001Dn-Of for emacs-devel@gnu.org; Sun, 25 Feb 2024 02:35:58 -0500 Original-Received: from serval.cherry.relay.mailchannels.net ([23.83.223.163]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1re93B-0002hj-5h; Sun, 25 Feb 2024 02:35:56 -0500 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 336766C2F25; Sun, 25 Feb 2024 07:35:48 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a258.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id CF6056C20A6; Sun, 25 Feb 2024 07:35:47 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1708846547; a=rsa-sha256; cv=none; b=criNpz5o8p3u+nSLyYr64qICmoMr3KjgZj4AQiWDAndpmiQyIbfCxcnZdqkCj32faCHFq+ nX3bBhSdkOAN/NfchWKbkyVKEbc2st8efT4vYSTsjQMJkBLJvv/TrN5hqOBWoEloDvlGct xHvlvvkyeEx/IQ8iiHmQzUAEadJoipRzIB2vuXUayglVgpMUAS6uS5L43zNWm6VT1v4pRh vfPuc3qTxlbYW6CYaW/QYm6X6WH79F5eXspmkX7RJWYoE60SEdeWL2CL5VX4jVi9pNbKQg DFyrPXpk1dS/MyczSUOUPf/pQfNkJDS7daA03hXX1SBANYS0j4lrjvblsI8/lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1708846547; 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=9Zj67LHc0+mYW/yZDeDFlzIs4A8nGIMjE8jAlKKCet8=; b=Lo44lMEqRe9efwlGy2EtVTpzsSeukIXGbzte+cZ4R7B71eyabo+NsHV+d9fp3s6pcxxhez qgc98IHxJoHAr62CZjxsKQIzeC6HYmzvoG+pM16iUWakHa0dQTH7k8s1eJaP1WDlXWYvbo jf2Vpj2rVfYoY2tcx2A/gEJCrkwSHN+5HZyzcbzSnRMJs6OFoYUPVjC4CSo8KfXO1w7Efi aly+PA15dHd9phgjKetRYsE63TnxYKQUDqXTeXjfV6wq1BIfXkrOcSHPRUaB1zrMjFCBV4 f8ACGx1xvnavGs35dYtZUh8ENdc9YBBadG87IjZV4KeReHoKHN+nFKYKe+Q+BA== ARC-Authentication-Results: i=1; rspamd-6bdc45795d-xsq8r; 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-Language-Coil: 2ad9c6850fdd312b_1708846548092_3289845730 X-MC-Loop-Signature: 1708846548092:268415246 X-MC-Ingress-Time: 1708846548092 Original-Received: from pdx1-sub0-mail-a258.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.127.49.71 (trex/6.9.2); Sun, 25 Feb 2024 07:35:48 +0000 Original-Received: from [10.43.2.174] (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-a258.dreamhost.com (Postfix) with ESMTPSA id 4TjFsb1v7Kz35; Sat, 24 Feb 2024 23:35:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alphapapa.net; s=dreamhost; t=1708846547; bh=HL4CREBMjiCHam4mMpC8mZShanTV6xybIUk/o4Z2Ovw=; h=Date:Subject:To:Cc:From:Content-Type:Content-Transfer-Encoding; b=XakyWyDPkUA/n7KvjuWXO1o36oUQqJNz9j1EJ7m5dg7+12a88KuIZfvWm8VvEL1hi czeeZ++0ZR19GwWiDO3C0jIte8Xw2CrvNARundvtg2K5kX/1tTmzICfl2DGCprDs4k Hp5DQCgJxwOyWx3qhh+cuIP3B9BxYQ2XXZXlQx1KkdawBEV0D9FO2t5yp1tnLjm6js 5Dc9XIhwQvUHAlnZGRa6V/pLI1yy8sRCmeD8llIhEHtNjAywXJHZIIUzWlbXS2zJ/r W3EKDlUuaWEjTl7JUUQEDvo7I7LND/0Oy6TDSb0JdoTCCUqUuPYCkioDkmv/QGTcQ4 hrFRLrplsSsiw== Content-Language: en-US In-Reply-To: <86edd2yy9g.fsf@gnu.org> Received-SPF: neutral client-ip=23.83.223.163; envelope-from=adam@alphapapa.net; helo=serval.cherry.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:316508 Archived-At: On 2/24/24 04:03, Eli Zaretskii wrote: >> Date: Sat, 24 Feb 2024 02:56:14 -0600 >> Cc: acorallo@gnu.org, adam@alphapapa.net, emacs-devel@gnu.org >> From: Adam Porter >> >>>> That looks nice to me. My only suggestion would be to change the symbol >>>> `function` to `type`, i.e. >>>> >>>> (defun sum (a b) >>>> (declare (type (integer integer) integer)) >>>> (+ a b)) >>>> >>>> Because it would be more concise and descriptive. >>> >>> FWIW, Andrea's proposal looks more descriptive to me. "Type" is too >>> general, whereas "function" is more specific. >> >> I don't understand what you mean. ISTM that "type" is exactly what's >> being declared > > Yes, but type of what? If you were to suggest function-type or > function-signature or something with "function" in its name, I'd like > it better. It seemed obvious to me that a `declare' form at the top of a `defun' pertains to the function. For example `(declare (debug ...))' declares the function's instrumentation--it's not `(declare (function-debug ...))'. So it seemed to me that `(declare (type ...))' would be sufficient, rather than `(declare (function ...))' or `(declare (function-type ...))'. But I don't have a strong opinion on this, and I won't argue with you if you disagree. My goals are simply advocating for: 1. Reducing verbosity while maintaining clarity. 2. Allowing for the future possibility of moving `declare-function' forms into the function body as `(declare (function ...))', which seems to me like a natural thing to do (see my other message).