All right, all right! Interim decision regarding qualified Object methods

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jul 12 15:38:06 PDT 2012


On 7/12/12 4:50 PM, Steven Schveighoffer wrote:
> On Thu, 12 Jul 2012 16:27:39 -0400, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> On 7/12/12 4:20 PM, Steven Schveighoffer wrote:
>>> I think this discussion is somewhat academic at this point, as Andrei
>>> seems not too keen on the idea of having dual base classes.
>>
>> Well I wasn't keen on eliminating the four methods and look what
>> happened!
>
> My personal opinion is we should simply eliminate the four methods (or
> at least the three required for AAs), fix AAs, and deal with the
> fallout. I can't really remember the last time I simply used
> obj1.opEquals(obj2) to do comparisons instead of obj1 == obj2 (which
> should do the right thing if obj1.opEquals(obj2) is valid). The code
> that relies on this is probably very rare. I certainly would *love* to
> rewrite all my opCmp and opEquals functions to accept the minimal base
> class instead of doing the dual dispatch dance with Object parameters.

I agree not a lot of people use obj1 == obj2 instead of 
obj1.opEquals(obj2), but I assume quite a few override opEquals and rely 
on it being called.

Andrei


More information about the Digitalmars-d mailing list