Why is D unpopular
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon Jun 13 10:29:10 UTC 2022
On Monday, 13 June 2022 at 10:13:30 UTC, Mike Parker wrote:
> On Monday, 13 June 2022 at 10:03:59 UTC, Ola Fosheim Grøstad
> wrote:
>
>>
>> It wasn't the subclass that tried to access, it was the owner
>> of the subclass, the module.
>
> *Through* the subclass.
No. You have direct access.
>> If the owner of Cyborgs
>> If a surgeon can operate
>
> I'm a Parker. My father is a Parker. But if you ask me for the
> contents of my father's safe, and I don't have the combination,
> then you aren't getting the contents of my father's safe. Ask
> me to put you in touch with my father though, and you can work
> something out.
This is not an example of inheritance. Inheritance is a
[subtyping relation](https://en.wikipedia.org/wiki/Subtyping).
If you let the Surgeon module own the Human blueprint and direct
access to all the brains of all Humans, then it follows that the
Surgeon module has to be given direct access to all Humans
whether you know if that Human also is a Woman or not.
Keep in mind that there are no pure Humans in the real world,
only Men or Women (or some other gendered variations). The fact
that we can instance Humans does not mean that they are not Women
or Men. It means that we don't care (or know) whether they are
Women or Men when we give them a computer representation.
More information about the Digitalmars-d
mailing list