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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Jul 12 12:09:20 PDT 2012


On 7/12/12 2:50 PM, H. S. Teoh wrote:
> On Thu, Jul 12, 2012 at 01:51:31PM -0400, Andrei Alexandrescu wrote:
>> On 7/12/12 1:40 PM, David Piepgrass wrote:
>>> 1. Most importantly, the C++ template approach is a big pain for
>>> large-scale systems, [...]
>>
>> The thing is, that can be done in an opt-in manner. People who want
>> methods in the root of the hierarchy can define a root that defines
>> them. But there's no way to opt out of inheriting Object. Basically
>> it's nice to not force people to buy into a constrained environment
>> without necessity.
>
> Having a class RawObject as a superclass of Object is an equally good
> solution.

As far as backward compatibility goes, I'm not sure. There's code out 
there that e.g. assumes Object has no supertype etc. (I wrote some.)

But one thing the recent discussion brought back to attention is that 
opEquals and opCmp are somewhat crappy. In D, they are in fact 
unnecessary, so it's better to undo that entire design if we can.


Andrei




More information about the Digitalmars-d mailing list