Non-ugly ways to implement a 'static' class or namespace?

Mike Parker aldacron at gmail.com
Wed Feb 15 02:14:30 UTC 2023


On Wednesday, 15 February 2023 at 01:16:00 UTC, thebluepandabear 
wrote:

>
> I think what you could say is that D lacks _encapsulation_ 
> which is also an OOP concept. So D is partially OOP but not 
> fully OOP due to there being no encapsulation in the language.

D does not lack encapsulation, it's just that the unit of 
encapsulation is the module. Everything private in a module is 
encapsulated from the perspective of the public API.

If you really want to prevent anything inside a module from 
accessing the private parts of a class, you can put the class in 
its own module.

Must we continue beating this horse?


More information about the Digitalmars-d-learn mailing list