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

Max Samukha maxsamukha at gmail.com
Fri Feb 10 07:04:31 UTC 2023


On Thursday, 9 February 2023 at 20:05:06 UTC, Ali Çehreli wrote:

> Besides, D has zero problems with its private implementation in 
> the sense that there has been zero bugs related to it being 
> that way.

That is how a Python aficionado would defend the absence of 
visibility attributes therein. "We don't have them, because _ is 
enough, and there are no bugs". And I would agree that D would be 
better off without visibility attributes entirely instead of 
having unending issues with them (private aliases, private + 
reflection, private + synchronized/invariant, etc).

> In contrast, I use D every day and love its relaxed attitude 
> towards private.

Having class-private doesn't preclude module-private. Dennis even 
submitted a PR implementing class-private, but it stalled because 
people couldn't agree on whether class-private should be "private 
to class" or "private to class instance".






More information about the Digitalmars-d-learn mailing list