`restricted` member variables

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jun 21 08:55:19 UTC 2022


On Tuesday, 21 June 2022 at 08:37:55 UTC, Max Samukha wrote:
> I am actually against any changes to the current situation. 
> Module-level private is *designed* to break encapsulation, so 
> breaking the invariants by module-level functions is expected.

Yes, I agree. Either be consistent with the idea that the module 
is the boundary for encapsulation or not.

It is better to give priority to plugging the holes that prevent 
people from writing code than preventing the compiler from 
accepting ill-conceived programs.

The current D compiler accepts too many programs, but that can be 
fixed with a linter.



More information about the Digitalmars-d mailing list