Why can't structs be derived from?

Ary Manzana ary at esperanto.org.ar
Wed Mar 16 08:08:16 PDT 2011


On 3/15/11 4:35 PM, Steven Schveighoffer wrote:
> On Tue, 15 Mar 2011 15:28:09 -0400, Jens <jne at somewhere.org> wrote:
>
>> Steven Schveighoffer wrote:
>>> On Tue, 15 Mar 2011 14:54:13 -0400, Jens <jne at somewhere.org> wrote:
>>>
>>>> I didn't ask how to do composition in D. I asked why composition
>>>> cannot be done via derivation, i.e., the reasoning behind the
>>>> language design choice. A design faux paus IMO.
>>>
>>> Because composition by inheritance can be *completely* implemented
>>> using alias this -- a feature that also provides other niceties. Why
>>> provide another mechanism to do the exact same thing, just because
>>> you are used to it?
>>
>> 1. I'm not convinced the other functionality is necessary.
>> 2. I eschew ugly syntax.
>
> Beauty is subjective, so I guess I can say at this point, go write your
> own language that is beautiful in your mind. Good luck.

Beauty is not that all subjective.

http://www.youtube.com/watch?v=PktUzdnBqWI

See my previous post. Which one you find more ugly?


More information about the Digitalmars-d mailing list