Hello Walter,

Doing lazy initialization certainly works, but it would require all
static member access to go through a check for initialization, first.
The cost of this check persists for a statically compiled language;
for a JITted language like C# the access can be rewritten to remove
the check.

That and I have some patterns I like using where I use "static this()" to inject results without any change to the code base. For that to work, they need to run before things get referenced.

void delegate(string)[string] args; // static this injects into here.

void main(string[] argv)
{
   foreach(string s; argv)
        args[GetBefor('=',s)](GetAfter('=',s));
}

--
... <IXOYE><



Reply via email to