emacs-devel
[Top][All Lists]
Advanced

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

Re: declare function/macro private


From: Lars Ingebrigtsen
Subject: Re: declare function/macro private
Date: Tue, 08 Jun 2021 11:43:53 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

"Paul W. Rankin" <pwr@bydasein.com> writes:

> The "--" convention is fine and I wouldn't suggest to change/replace
> this; it's clear to people what it means once they've learnt what the
> convention means.

[...]

> Also I just dislike computer heuristics.

The "--" convention is heuristic-ey...  But it is very reminiscent of
the Common Lisp foo:bar vs foo::private-bar thing (which is not a
heuristic, but a language thing).

That is, I think it's very nice to have the code be quite explicit about
what's internal and what's external, so if you're using
foo--private-thing in Emacs outside of a file called foo*.el, you know
you're doing something that may break.

This being a convention instead of a language feature does have
problems.  For instance, if somebody decides to make a private function
public, all the usages have to be renamed.  (declare (private ...))
avoids that.

But...  I think I agree with people that this isn't really the way to
go -- the current convention provides more information than the declare
would do (most of all, it says what the prefix is).

It'd be nice if Emacs grew a real package system -- then this
private/public thing would happen naturally.  But I don't think adding
`private' in and of itself is the way forward.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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