DIP66 - Multiple alias this

mw mingwu at gmail.com
Mon Sep 28 18:56:40 UTC 2020


On Monday, 28 September 2020 at 18:44:51 UTC, H. S. Teoh wrote:
> On Mon, Sep 28, 2020 at 06:28:05PM +0000, mw via Digitalmars-d 
> wrote:
>> On Monday, 28 September 2020 at 18:13:15 UTC, H. S. Teoh wrote:
>> > On Mon, Sep 28, 2020 at 05:59:19PM +0000, mw via 
>> > Digitalmars-d wrote:
>> > 
>> > As somebody already said, that's all well and good for 
>> > Eiffel. It's not so clear how to integrate this nicely in D.
>> 
>> D has `alias` already,
> [...]
>
> `alias this` is one of the things that seemed like a good idea 
> at the time, but is turning out to be something that leads to 
> code smells.  If anything, we'd like to get rid of it rather 
> than extend it!

On a second thought, I agree we'd better not to extend `alias`.

It's all about resolve name clashing: `alias` means synonyms; 
let's just borrow from Eiffel, instead of re-invent the wheels: 
the main concepts to solve multiple inheritance are these 5 
keywords:

https://www.eiffel.org/doc/eiffel/Eiffel_programming_language_reserved_words

`rename`
`export`
`undefine`
`redefine`   -- D's override
`select`



More information about the Digitalmars-d mailing list