ProtoObject and comparison for equality and ordering

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed May 15 02:09:24 UTC 2019


On 5/14/19 2:38 AM, Mike Franklin wrote:
> On Wednesday, 15 May 2019 at 01:02:49 UTC, Andrei Alexandrescu wrote:
> 
>> Overall: I dream of a D landscape whereby this is enough of a problem 
>> to deserve discussion, a DIP, review, and implementation. As things 
>> are there are sufficient things to discuss and improve in D to make 
>> this exchange ironic.
> 
> This is a fundamental feature of the new proposed object hierarchy on 
> which so much D code will depend.  How is this not worthy of 
> brainstorming, exploration, and consideration?  If it's not done well, 
> and thoroughly, we'll be inventing yet another object hierarchy 5 years 
> from now.  It also serves to educate those participating in and watching 
> this discussion so they understand why things are the way they are.  
> Then can then spread that knowledge to the next generation of D 
> programmers without having to query those that did that actual work and 
> made the decision.

Of course. Changing how opCmp works does not qualify for all that.

It's all about change vs. addition. We in the D community are obsessed 
with change; if we only changed a little how that works, it would be so 
good. Yet changing how things that work work (repetition is intentional) 
is by definition low-yield; addition is fundamentally more generous and 
offers unbounded potential.

(Of course changing something that doesn't work is necessary. It's Right 
Work. Like fixing the shared qualifier.)

In this case, ProtoObject is a carefully considered addition that 
bypasses a malfunctioning artery - the Object class. But it doesn't 
change or remove it, because there's much live tissue connected to it. 
Changing how opCmp works - inserting a little botox during the surgery - 
is a damaging distraction.


More information about the Digitalmars-d mailing list