Object Oriented Programming with D Language. Private access specifier.

BCS ao at pathlink.com
Thu Aug 21 10:28:30 PDT 2008


Reply to DF,

> It is easy to say that it's ok, than find out why it is ok.
> 
> I'm not saying that D implementation of "private" access specifier is
> wrong, I just want to know why "private" is implemented in this way.
> 
> Is it just because it solves language-specific problems or there is
> any other reason for that?
> 

You are asserting that encapsulation should be at the class level.
D chose to implement it at the module (file) level.

Aside from that distinction do you have any issues with the way it is implemented?

A side note, would you have issues with nested classes having access to enclosing 
class variables or the other way around?
There is good arguments for allowing or denying just about any class of access, 
setting up an access control system that can cover all of them is impractical. 
Therefor you get to pick and chose.





More information about the Digitalmars-d mailing list