Why do private member variables behaved like protected in the same module when creating deriving class?

unprotected-entity unprotected-entity at gmail.com
Wed Oct 31 04:55:48 UTC 2018


On Tuesday, 30 October 2018 at 09:43:54 UTC, ShadoLight wrote:
> At this point this threat are really  arguing about a personal 
> preferences; it is not a black or white affair.

Yes, true, sort of.

The problem as I see it, is that D does not even give you (me) 
the option to implement such my preference - which is to declare 
a private member of a class within a module, and have the 
guarantee (by the compiler) that other code my module does not 
directly touch it. It's not a big ask really. It's what I already 
have in C++, Java and C#.

It doesn't mean changing what private means.

But it could, rather easily, mean adding some syntax that would 
allow me to clearly declare my intentions (such as: strict 
private  - as freepascal do it ( I made a post about this, but my 
posts are not being put up for some reason - maybe the person who 
does that thing is asleep or whatever.

I can't have a conversation under those conditions (i.e. where 
some person, somewhere, at some random time, decides whether 
posts should be displayed - if they get around to it that is..), 
so I'm not going to bother wasting any more time with this 
matter. I just got new xbox one x, and rdr2 - so I'm attention 
will be elsewhere, for some time .....




More information about the Digitalmars-d mailing list