Why is D unpopular

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon Jun 13 10:03:59 UTC 2022


On Monday, 13 June 2022 at 09:34:46 UTC, Mike Parker wrote:
> No, it does not follow in this case. A subclass does not have 
> access to the private members of the superclass in D unless 
> they are declared in the same module. So what that code is 
> doing is saying, "Hey Bar, give me this field that you don't 
> have access to."

It wasn't the subclass that tried to access, it was the owner of 
the subclass, the module.

If the owner of Cyborgs have direct access to the brain that all 
Cyborgs possess, then it follows that it also must have direct 
access to the brain of PinkCyborgs too without having to call it 
a Cyborg. A PinkCyborg is also a Cyborg.

If a surgeon can operate directly on the brain of a Human, then 
it follows that he also should be able to operate directly on the 
brain of Men and Women, without having to claim that they are 
just Humans to him (and that he does not care about their gender 
specific attributes). Men and Women are undeniably Human. It 
should not matter whether the Ambulance personell says "this is a 
Man" or "this is a Human".





More information about the Digitalmars-d mailing list