On 5/13/19 9:39 PM, Steven Schveighoffer wrote:
I have just discovered an interesting behavior, and I'm wondering if
this behavior is intentional or even necessary.
Let's say I have this module called mod2.d:
module mod2;
string buildModData()
{
string result;
foreach(i; 0 .. 10000)
result = result ~ "lots and lots and lots of data";
return result;
}
static moddata = buildModData();
A workaround found by Jonathan Davis:
string moddata() {
static result = buildModData();
return result;
}
-Steve
