emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding a DECLARE spec equivalent to DECLARE-FUNCTION


From: Adam Porter
Subject: Re: Adding a DECLARE spec equivalent to DECLARE-FUNCTION
Date: Sat, 16 Mar 2024 23:09:59 -0500
User-agent: Mozilla Thunderbird

Hi Basil,

Thanks for your thoughtful reply.

On 3/16/24 05:04, Basil L. Contovounesios wrote:

My vote is for instead teaching the compiler to treat declare-function
more like it treats defvar, in that the effect of declare-function
should be made local to the current lexical scope.  [It is already
possible to write this way, and I've been known to, but sadly the effect
is global.]  This wish has been raised and agreed on here (at least in
passing) before.

This would reap all the benefits of points 1-4, as well as an additional
one: that declare-function is lexically closer to the implementation
through which the need for the declaration arises.  I think a
declaration at the top of a function is more likely to be forgotten and
become stale as the implementation changes.

You raise some good points.  I would be happy with that as well.

--Adam



reply via email to

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