static this sucks, we should deprecate it

Walter Bright newshound1 at digitalmars.com
Sun May 31 14:21:11 PDT 2009


Christopher Wright wrote:
> Eh, this would have to extend to every function, since static ctors can 
> call functions. And these functions can be provided without 
> implementations via a .di file. This is fail.

Such problems are called "whole program analysis", or "interprocedural 
analysis". There are a lot of cool things you can do with that, but of 
course they require 100% of the program text to be available to the 
compiler.

That isn't going to happen with D (even if all the D source were 
available, what about calling C binaries?). So we have to rely on other 
mechanisms.



More information about the Digitalmars-d mailing list