[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
declare function/macro private
From: |
Paul W. Rankin |
Subject: |
declare function/macro private |
Date: |
Sun, 6 Jun 2021 14:27:58 +1000 |
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.
--
Paul W. Rankin
https://bydasein.com
The single best thing you can do for the world is to delete your social media
accounts.