Private symbol (in)visibility within a module

NotYouAgain NotYouAgain at gmail.com
Sun May 5 08:01:12 UTC 2024


On Sunday, 5 May 2024 at 07:51:00 UTC, NotYouAgain wrote:
> ..

ok... I can't resist this one either:

"Private inside a module must mean what the person on the street 
thinks. No visibility outside the module at all. There are no two 
ways about it."  - Andrei Alexandrescu

https://forum.dlang.org/post/kb60n5$1v89$1@digitalmars.com

Of course that issue has since been fixed, thankfully.

see: 
https://dlang.org/changelog/2.105.0.html#dmd.private-deprecation-error

Took a while though :-(

But I have to wonder why Andrei's didn't apply the exact same 
logic to what private at the class/struct level means to the 
person on the street. No visibility outside of the class/struct.

If I take his argument to where it should logically lead, then 
you will likely end up with a proposal for private(this), or a 
proposal for Swift like accessbility (fileprivate and private).

I much prefer the later, as it make far more sense.

On the otherhand, private(this) won't break anything, which is 
what will certainly be on people's mind.



More information about the dip.ideas mailing list