emacs-devel
[Top][All Lists]
Advanced

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

Re: Declaring Lisp function types


From: Tomas Hlavaty
Subject: Re: Declaring Lisp function types
Date: Sat, 16 Mar 2024 15:56:30 +0100

On Sat 16 Mar 2024 at 16:06, Eli Zaretskii <eliz@gnu.org> wrote:
> Yes, but who would search for names that are symbols
> of a programming language?

I do search for lisp symbols all the time.
Do you not search for lisp symbols?

> If you search for "ptrdiff_t" or even "__attribute__", you get gobs of
> hits.

And?

Those are also reasonably good names.

Now imagine if "ptrdiff_t" was called "function" instead.

> Same if you search for "defun" or "defmac".

defun and defmacro are great symbol names.
Specific, unique and as a bonus short.

> This is simply not a good idea, and the fact that we choose this or
> that name for a type declaration will never help you, as long as many
> instances use that declaration.

The focus is "Declaring Lisp function types".  If it had a good symbol
name, I could find relevant places without false positives.

>> In the context of "Declaring Lisp function types", grep gives too many
>> false positives when searching for the symbol 'function' or 'type'.
>
> It will give too many hits no matter how we call it.

The better name, the less false positives.

> That's just sheer luck: not a lot of functions have these properties.

The point is reducing false positives.

> By contrast, _every_ function will have some type and some signature,
> so you will have a gazillion of hits if you search for those, no
> matter what its name.

Every?
What kind of lisp will elisp be?

>> The symbol "function" already has specific meaning.  Using it as a
>> declare spec property name is just bad.  For example, eldoc or M-. shows
>> something unrelated to "Declaring Lisp function types".
>
> Some of these are irrelevant to the issue at hand, the others will
> have to be adapted to the change, if we care enough.

Why would anything have to be adapted?
Why not simply use a better symbol name?

> Sorry, you lost me here.  How is this related to the issue discussed
> in this thread?

It shows how good symbol names help in various ways.
It also shows how bad symbol names do not help.

It shows that using the symbol name 'function' for "Declaring Lisp
function types" is just bad.



reply via email to

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