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

Roman D. Boiko rb at d-coding.com
Thu Jul 12 06:41:51 PDT 2012


On Thursday, 12 July 2012 at 13:39:54 UTC, Steven Schveighoffer 
wrote:
> On Thu, 12 Jul 2012 09:20:47 -0400, Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> wrote:
>> If we define alternative free generic functions in object.d 
>> for the four culprit methods (and have the compiler, druntime, 
>> and stdlib use them instead of the methods), those functions 
>> can check whether a given class object has overridden the 
>> old-style functions. In that case, that means we're dealing 
>> with legacy classes and proceed the old-style way. Otherwise, 
>> proceed the new way.
>
> Hm... I don't like this, it slows down a very basic function.
>
> I think if we want a solution that allows old code to work, why 
> not what Timon suggested? Have a base class for Object 
> (RawObject was suggested) that does not implement the 
> opFunctions.  It would still break code, but would be easy to 
> fix (just specify your class derives from Object, not 
> RawObject).
>
> -Steve




More information about the Digitalmars-d mailing list