We need an internal keyword.
Laurent Tréguier
laurent.treguier.sink at gmail.com
Mon Oct 22 07:57:17 UTC 2018
On Sunday, 21 October 2018 at 23:50:57 UTC, 12345swordy wrote:
> If the cost out way the benefits then I simply introduce the
> "strict" keyword to avoid code breakage, or introduce the
> optional module scoping.
>
> -Alex
Looking at the dlang.org page about visibility attributes, the
`package` keyword can have an argument specifying which package
has access to the symbol.
What if `private` could have an argument dictating which other
symbol could have access to that private symbol ?
Setting this argument to the private symbol's own class would
effectively make it strictly private. This wouldn't require a new
keyword, and that syntax is not valid D code so it wouldn't break
any existing code.
Though it would look a bit weird, and it would also basically
introduce a sort of "friend" feature.
I don't know, that was just a random thought that crossed my mind
just now.
More information about the Digitalmars-d
mailing list