From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Marco Antoniotti Newsgroups: gmane.emacs.devel Subject: Re: (declare (type (function... Date: Fri, 10 May 2024 11:50:03 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006580250618167668" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 10 12:36:51 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 1s5NcR-0000Ae-3k for ged-emacs-devel@m.gmane-mx.org; Fri, 10 May 2024 12:36:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s5Nc8-0000rc-AL; Fri, 10 May 2024 06:36:32 -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 1s5MtR-0007Ag-Tr for emacs-devel@gnu.org; Fri, 10 May 2024 05:50:22 -0400 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s5MtO-0001Pw-Gi for emacs-devel@gnu.org; Fri, 10 May 2024 05:50:21 -0400 Original-Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-5206a5854adso2067207e87.0 for ; Fri, 10 May 2024 02:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unimib.it; s=google; t=1715334615; x=1715939415; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=d2ZTFbsWGh+U15j6zT7peVGjR4rEKhNDU4Xt2e/s2Zc=; b=Ol/U+0+CmQ6q7GbC1VANuZoZTK5fuv7js7PpL6a6sUVFXcIPlpEU3eHMPE9/bFauR2 xQQHETeG5DnHVvaPJglxpwi5yNM/7cqQKi+6f5lpsK/WUkQpFBEfnClopIGWlZSQBzpP o3CYHw6JN2aGIEbsZ3tmL8g3TrdaymY/bQve8b4VwH0FUmUufK0jvPnFzlA6r2bbiDzL we1N6AuoS7XWxMLeajed2Bc6BxQYUoK+wxdxRom6xfrniAnhKuxIASWmmzcUySYMOseo Xsb9VB4GUXZ0Xz4Q6nMpqk3xoOx3guGrvi1QMmkerECOxxTiakpXjPWyAOTJKGCSIxq9 7Aug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715334615; x=1715939415; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=d2ZTFbsWGh+U15j6zT7peVGjR4rEKhNDU4Xt2e/s2Zc=; b=R48oqzkA6sMll+BSusjJjUBeZFXBf3+1clSGm3O/CXkl2MSz+oQLmHzj5eI1f8xQ09 ViEFEwg888sIumf9P4z89zE7rxZ7wzRohUbfvrNk2QRCQWtoy7ggaBQ/tveTNyAy0QFy cOMfAws9mdrzdxg/kamE9DIXpw9+KXbBuNsZWYzEC4QFO2tp796I6rpapMoMrSR2Jf4z i7mlgUktelD2U51bTmVWDkdsqoLxQShJUedANUsKxwdRO5aJUNboS7URAtJo21Al2jgO /MyQ81Djag3d+BN6ZMuNj7oHDpwwj9PXYd6FB8NGkFR4hHir12PhAhY0U2gyQR+LhkCo Vr+A== X-Gm-Message-State: AOJu0YxFixWyQf8zwSpvYlq/2y7si5wn1Eg+ZxvI5J81s1t9EbFwvnUD X3Rj8Ymix1Fmlgl7Swfg/bJKpOkOd44e9oIgO7/M1nDVcnkffRQ8MzNVF7vbR2QrJiO3SD47jQS 7Zdxz1LjJ1z17tR6k1OLstynDSZ2KY+iZ9NBUBlzCviaHuzy2TEnmnQ== X-Google-Smtp-Source: AGHT+IHRdRGLqHzRc82RZ3B3O+MlBO1VDHRJViKE1TrAKM7xLg3l69a+T5TZnOSIujH4/UG54FOTOa/NNbzmN+Vr/+A= X-Received: by 2002:a05:6512:ac2:b0:51d:3fe4:c3cc with SMTP id 2adb3069b0e04-5220f774da8mr1838930e87.0.1715334614966; Fri, 10 May 2024 02:50:14 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=marco.antoniotti@unimib.it; helo=mail-lf1-x132.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, HTML_MESSAGE=0.001, MIME_BOUND_DIGITS_15=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 10 May 2024 06:36:28 -0400 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:319129 Archived-At: --0000000000006580250618167668 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Dear Andrea The point is NOT to diverge from Common Lisp. Such divergence is - IMHO - unwarranted. Plus, the proposal for the ftype declaration also carries over to type declarations, which, again, are useful per se, even if the compiler is "smart enough" (ok; this one is for old-timers :) ) Having said that, a provision can be made that a nameless ftype declaration at a function top level refers to the "definenda" function. Again, having to use ftype instead of type is a consequence of ELisp being a 2-lisp. Cheers MA On Fri, May 10, 2024 at 8:47=E2=80=AFAM Andrea Corallo w= rote: > Marco Antoniotti writes: > > > Ciao Andrea > > > > The presentation I attended gave me the idea of "ranting talks" at the > next ELS :) > > > > Having said so, I now think that, to save goat and cabbage, what you > want is > > > > (defun foo (x y) > > (declare (ftype (function (integer number) number) foo)) > > (+ x y)) > > > > Common lispers can live with that. > > > > All the best > > > > MA > > Ciao Mario, > > not sure what maintainers think about it, I'm not in love with this > solution because one has to repeat 'foo' two times and we don't support > anyway unsing declare inside a function to declare another one. > > Mmmhh > > Andrea > --=20 Marco Antoniotti, Professor tel. +39 - 02 64 48 79 01 DISCo, University of Milan-Bicocca U14 2043 http://dcb.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY --0000000000006580250618167668 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Andrea

The point is NOT= to diverge from Common Lisp.=C2=A0 Such divergence is - IMHO - unwarranted= .=C2=A0 Plus, the proposal for the ft= ype declaration also carries over to type declarations, which, again, are useful per se, even if t= he compiler is "smart enough" (ok; this one is for old-timers :) = )

Having said that, a provision can be made that a namele= ss ftype declaration at a func= tion top level refers to the "definenda" function.=C2=A0 Again, h= aving to use ftype instead of = type is a consequence of ELisp= being a 2-lisp.

Cheers

M= A

On Fri, May 10, 2024 at 8:47=E2=80=AFAM Andrea Corallo <acorallo@gnu.org> wrote:
Marco Antoniotti <marco.antoniotti@u= nimib.it> writes:

> Ciao Andrea
>
> The presentation I attended gave me the idea of "ranting talks&qu= ot; at the next ELS :)
>
> Having said so, I now think that, to save goat and cabbage, what you w= ant is
>
> (defun foo (x y)
>=C2=A0 =C2=A0 (declare (ftype (function (integer number) number) foo))<= br> >=C2=A0 =C2=A0 (+ x y))
>
> Common lispers can live with that.
>
> All the best
>
> MA

Ciao Mario,

not sure what maintainers think about it, I'm not in love with this
solution because one has to repeat 'foo' two times and we don't= support
anyway unsing declare inside a function to declare another one.

Mmmhh

=C2=A0 =C2=A0Andrea


--
Marco Antoniotti, Professor=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 tel. +39 - 02 64 48 79 01
DISCo, University = of Milan-Bicocca U14 2043=C2=A0=C2=A0 http://dcb.disco.unimib.it
Viale Sarca 336
I-= 20126 Milan (MI) ITALY
--0000000000006580250618167668--