static this sucks, we should deprecate it

Walter Bright newshound1 at digitalmars.com
Thu May 28 22:36:31 PDT 2009


Robert Fraser wrote:
> Walter Bright wrote:
>> Ary Borenszweig wrote:
>>> The thing is, I've been using Java for more than 7 years now and I 
>>> never got any error because of intialization dependency. It would be 
>>> nice to turn that check off in D and see the results. Maybe no one 
>>> will complain about it.
>>
>> Eliminating implementation-defined behavior like that makes a language 
>> more reliable and portable. Java's failure to address this is a hole 
>> in their system.
> 
> It's not implementation-defined. When a class is loaded (the times at 
> which it is are specified), static members are initialized and static 
> blocks run in the order that they appear in the source file.

It's unreliable because how do you specify the load order? And how does 
the user relate that to the source semantics?



More information about the Digitalmars-d mailing list