Generality creep

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Mar 28 20:05:41 UTC 2019


On 3/28/19 3:43 PM, ag0aep6g wrote:
> On 28.03.19 20:24, Andrei Alexandrescu wrote:
>> Changing the entire standard library to accommodate wackiness in 
>> RefRange is a poor executive decision regardless. The recent changes 
>> must be undone.
> 
> No one is arguing in favor of doing what I've in my PRs on the issue. 
> Not even me.

Yes, I saw your pain seeping through the lines. The valiant effort 
hasn't gone unnoticed and is appreciated.

> I've started that endeavor, because the only tangible response I got 
> when I asked what do do was from Jonathan M Davis who said: "it could be 
> argued that generic, range-based functions simply shouldn't ever be 
> assigning one range to another."[1]

This is a sign things have gotten off the rail. Assignment should be 
accessible and have obvious semantics.

> If you prefer and approve removing RefRange.opAssign instead, I'm all 
> for that.
> 
> Also note that Walter himself has done similar pull requests:
> 
> https://github.com/dlang/phobos/pull/6900
> https://github.com/dlang/phobos/pull/6903
> 
> He uses constructors instead of "wonky" `move`, but the effect with 
> regards to issue 18657 is the same: RefRange.opAssign is not called. If 
> that's an acceptable way to make Phobos compatible with RefRange, that's 
> also fine with me.
> 
> 
> [1] 
> https://forum.dlang.org/post/mailman.1557.1521939012.3374.digitalmars-d@puremagic.com 

RefRange is a cancer.

Changing all data structures and algorithms to support it is the cancer 
going into metastasis.

We must excise the cancerous tissue.



More information about the Digitalmars-d mailing list