DIP66 - Multiple alias this

Andrei Alexandrescu SeeWebsiteForEmail at erdani.com
Mon Sep 28 19:55:10 UTC 2020


On 9/28/20 2:44 PM, 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!

I'd love to get a better idea about this, e.g. a few clear examples of 
bad uses and other few good examples where it's a win. My intuition 
vaguely revolves around "aliasing to an rvalue is bad and lvalue is 
good" but I year for clarity.



More information about the Digitalmars-d mailing list