Why is D unpopular?
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Mon Nov 8 18:02:27 UTC 2021
On Monday, 8 November 2021 at 17:40:08 UTC, 12345swordy wrote:
> class as a reference type makes sense as you are dealing with
> polymorphism.
Maybe so, but you could have the same typing scheme. Just make it
a typing error to instantiate it as a non-reference type.
So you could for instance collapse struct/class, yet allow the
programmer to specify that this particular struct/class can only
be instantiated as heap-object.
And you could similarly put a ban on virtual members. So rather
than having special cases struct and class, you allow the
addition of constraints to a singular aggregate concept.
More information about the Digitalmars-d
mailing list