The Final(ize) Challenge

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon May 18 16:04:21 PDT 2009


Christopher Wright wrote:
> Andrei Alexandrescu wrote:
>> I think you need to operate exclusively with string mixins in 
>> Finalize, so __ident would be of marginal help there. Also, static 
>> foreach is much more necessary.
> 
> That is a huge problem.
> 
> Let's say that the class you want to finalize, Target, has a method like 
> this:
> void foo(SomeClass){}
> 
> Let's say that SomeClass is private and in the same module as Target.
> 
> You *may* be able to do this with templates. Probably.
> 
> You *can never* do this with a string mixin.

Of course you can. All you have to do is first check whether the call is 
accessible from your instantiation point, BEFORE generating the string.


Andrei



More information about the Digitalmars-d mailing list