Extending D's support for object-oriented design with private(this)

Arafel er.krali at gmail.com
Sat Apr 27 10:58:17 UTC 2024


On 27/4/24 12:22, Kagamin wrote:
> In OOP world you enforce contracts with interfaces, not with access 
> attributes. Do you really come from java?

I don't understand you. Are you arguing that we don't need `private`, or 
even visibility, at all, because we should just use interfaces?

Because otherwise, once you accept the need for `private`, then the 
question is what the limits should be.

D chose "module", which I can understand, but don't share, at least not 
as the only option. I think the class / scope is a much more natural 
boundary, as it is for visibility.


More information about the dip.ideas mailing list