emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Declaring Lisp function types


From: Adam Porter
Subject: Re: Declaring Lisp function types
Date: Fri, 15 Mar 2024 19:01:44 -0500
User-agent: Mozilla Thunderbird

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 <https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00790.html> and <https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00815.html>, and in this bug report <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69521>, and again on the list in this separate thread, as I was instructed <https://lists.gnu.org/archive/html/emacs-devel/2024-03/msg00118.html>, 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]