How high level is D?
Meta
jared771 at gmail.com
Wed Nov 21 16:30:30 UTC 2018
On Wednesday, 21 November 2018 at 10:27:11 UTC, NoMoreBugs wrote:
> Well, at a high level, D does support the notion of a class.
>
> However, D does not treat a class as an isolated conceptual
> unit (a type).
>
> You can pretend a class is such a unit however, by isolating it
> within its own module.
What? D certainly does "treat classes as types". Every class in D
is its own type and supoorts the reguar methods of encapsulation
as you would expect. The only difference is that in D, private
class members and methods are module-public, meaning that
anything else in the module can freely access them. That does not
break encapsulation by any means, however.
More information about the Digitalmars-d
mailing list