all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Antoniotti <marco.antoniotti@unimib.it>
To: Tomas Hlavaty <tom@logand.com>
Cc: emacs-devel@gnu.org
Subject: Re: (declare (type (function...
Date: Tue, 7 May 2024 19:10:46 +0200	[thread overview]
Message-ID: <CAG0Nw2knMT7bakej-6pVrxHG4HCwq8d-ezPaGdqrSCnENpNkBQ@mail.gmail.com> (raw)
In-Reply-To: <87h6f98sus.fsf@neko.mail-host-address-is-not-set>

[-- Attachment #1: Type: text/plain, Size: 2385 bytes --]

Hi

pardon me, but

      grep type....

would yield many more hits, and I do not understand why this is relevant to
the issue.

The points are two: (1) gratuitous difference from Common Lisp (*) and (2)
potential issues with down the road useful and rather obvious uses of
declare forms (cfr., the let example).

Granted (1) can be "documented away", by saying that type declarations at
the top level are "special", but (2) should be taken into consideration.

Having said that, I think that signature or funsig or something other than
type, conveying the actual meaning of that specific declaration would be
better.  Or this could be dealt with as in

(defun *foo* (x)
    (declare (*ftype* (function (integer) float) *foo*))
    (+ x 42.0))

IMHO, it makes more sense to the Common Lisper.  After all, ELisp is a
2-Lisp.

All the best

MA





On Tue, May 7, 2024 at 6:55 PM Tomas Hlavaty <tom@logand.com> wrote:

> On Tue 07 May 2024 at 13:55, Marco Antoniotti <marco.antoniotti@unimib.it>
> wrote:
> > IMHO (and, I am not afraid to say, of many common lispers) this is
> > shortsighted and a rather gratuitous departure from what CL does.  With
> > some potential unintended consequences down the road.
>
> There was a discussion about this.
>
> id:yp15xyf88yb.fsf@fencepost.gnu.org
> Andrea Corallo <acorallo@gnu.org> (February 23) ()
> Subject: Declaring Lisp function types
> To: emacs-devel@gnu.org
> Date: Fri, 23 Feb 2024 11:02:52 -0500
>
> also
>
> id:jwv4jdne65n.fsf-monnier+emacs@gnu.org
> Stefan Monnier <monnier@iro.umontreal.ca> (March 03) ()
> Subject: Re: Declaring Lisp function types
> To: Andrea Corallo <acorallo@gnu.org>
> Cc: "Stefan Monnier via Emacs development discussions." <
> emacs-devel@gnu.org>
> Date: Sun, 03 Mar 2024 09:52:23 -0500
> [...]
> Then I'd go with
> (declare (type (function ..)))
> [...]
>
> > (defun foo (x)
> >     *(declare (signature (function (integer) float))*
> >     (+ x 42.0))
>
> grep signature ~/mr/emacs would yield lots of false positives
>
> function-signature or something like that would be better name.
> but this was also discussed already.
>


-- 
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

[-- Attachment #2: Type: text/html, Size: 4146 bytes --]

  reply	other threads:[~2024-05-07 17:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 11:55 (declare (type (function Marco Antoniotti
2024-05-07 16:55 ` Tomas Hlavaty
2024-05-07 17:10   ` Marco Antoniotti [this message]
2024-05-07 17:38     ` Tomas Hlavaty
2024-05-07 17:52       ` Marco Antoniotti
2024-05-07 20:32 ` Andrea Corallo
2024-05-08  2:36   ` Emanuel Berg
2024-05-09  3:21     ` Tomas Hlavaty
2024-05-08  2:44   ` Emanuel Berg
2024-05-08 11:36   ` Marco Antoniotti
2024-05-09  3:33     ` Tomas Hlavaty
2024-05-09 13:19     ` Simon Leinen
2024-05-09 13:43       ` Emanuel Berg
2024-05-10  6:47     ` Andrea Corallo
2024-05-10  9:50       ` Marco Antoniotti
2024-05-10 10:21         ` Andrea Corallo
2024-05-10 11:53           ` Marco Antoniotti
2024-05-10 14:04           ` Stefan Monnier
2024-05-10 14:17             ` Marco Antoniotti
2024-05-11 10:29           ` Eli Zaretskii
2024-05-13 21:12             ` Andrea Corallo
2024-05-14  9:26               ` Andrea Corallo
2024-05-14 10:04                 ` Marco Antoniotti

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG0Nw2knMT7bakej-6pVrxHG4HCwq8d-ezPaGdqrSCnENpNkBQ@mail.gmail.com \
    --to=marco.antoniotti@unimib.it \
    --cc=emacs-devel@gnu.org \
    --cc=tom@logand.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.