[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: declare function/macro private
From: |
Stefan Monnier |
Subject: |
Re: declare function/macro private |
Date: |
Sun, 06 Jun 2021 16:12:42 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Tassilo Horn [2021-06-06 20:12:49] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> I think the "--" convention actually includes an extra information
>> compared to yours which could be useful here: we could warn for uses
>> of "foo--" if and only if the use appears in something whose name
>> doesn't start with "foo-".
>>
>> IOW, use the string before the "--" as the definition of the "library"
>> (so that would support cases where a library is spread over several
>> files, as well as the case where a single file contains "internal
>> libraries").
>
> If my package was structured like
>
> foo.el
> foo-search.el
> foo-parse.el
>
> I'd find it quite natural to name a private function in foo-search.el
> `foo-search--do-stuff'. Of course, it's ok if my `foo-base-do-stuff'
> function from foo.el calls it but it would trigger a warning with your
> approach because the "library" would be foo-search, no?
Indeed, the idea is that you'd have to use foo--search-do-stuff for
those functions which are private to your foo package but not to
foo-search.el, whereas you'd use foo-search--do-stuff for functions
which are not only private to your package but even private to
foo-search.el.
Stefan
Re: declare function/macro private, Paul W. Rankin, 2021/06/06