restructuring name hiding around the notion of hijacking

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Thu Oct 1 20:52:28 PDT 2009


Michel Fortin wrote:
> On 2009-10-01 12:29:39 -0400, Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> said:
> 
>>> I think it's a good idea, but there should be a way to *override* 
>>> static functions.
>>
>> That has the same risks. The problem right now is that in order to use 
>> a class, you must absorb the definition of that class and that of each 
>> superclass of it, all the way up to Object. With hijacking thwarted, 
>> you can specify stuff in the base class that you can be sure will 
>> continue to work the same in derived classes. I believe this makes 
>> using classes quite a lot easier and safer.
> 
> But it breaks one pattern of mine. In the D/Objective-C bridge I have a 
> few static functions and variables that must be redefined for each 
> subclass defining an Objective-C interface.

I'd say that's a questionable practice (but then I don't know any more 
details).

Andrei



More information about the Digitalmars-d mailing list