emacs-devel
[Top][All Lists]
Advanced

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

Re: declare function/macro private


From: Omar Polo
Subject: Re: declare function/macro private
Date: Sun, 06 Jun 2021 09:09:42 +0200
User-agent: mu4e 1.4.15; emacs 28.0.50

Paul W. Rankin via Emacs development discussions. <emacs-devel@gnu.org> writes:

> Given we have a function/macro declare interactive-only property, would it be 
> worthwhile to consider a `private' property?
>
> Of course there's already the convention of prefix--my-private-function, but 
> my thinking here is that a program could declare a function/macro as private, 
> then the compiler could signal a warning/error if that function appeared in a 
> library outside the library it was defined and declared private.
>
> e.g. in foo.el:
>
> (defun foo-private ()
>   (declare (private "use `foo-public' instead."))
>   ...)
>
> (provide 'foo)
>
> ..in bar.el:
>
> (defun bar-function ()
>   (foo-private))
>
> Compiling bar.el would signal a warning/error with hint to use `foo-public' 
> instead.

but if foo.el and bar.el are part of the same package, wouldn't be fine
for bar.el to use internal functions from bar.el?



reply via email to

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