static this sucks, we should deprecate it

Unknown W. Brackets unknown at simplemachines.org
Thu May 28 21:35:56 PDT 2009


Because you've never tried to use data initialized circularly.  I wonder 
what would happen in Java if you did?

-[Unknown]


Frank Benoit wrote:
> Unknown W. Brackets schrieb:
>> Probably a silly idea, but what about (or similar):
>>
>> static this: mod.name, mod.name2, mod.name3
>> {
>> }
>>
>> For a dependency list.  I may be wrong, but afaik the main problems stem
>> from either wrong order or co-dependence (which needs to be solved by
>> the programmer.)
>>
>> At least with this, you could ask the compiler for an order,
>> potentially.  If the other modules had no static this, it could ignore
>> it, allowing future proofing.
>>
>> But, maybe that's an ugly hack.
>>
>> -[Unknown]
>>
> 
> In Java the
> static { /* static ctor code */ }
> does not have the circular dependency problem. why is that?



More information about the Digitalmars-d mailing list