Eigenpoll : D wish list : invariant function
invariant function is needed for using FileExp(ImportExpression), MixinExp and other compile-time expressions...
Example:
invariant string f(string f){
string rv;
string s = import(f);//file exp
foreach(l;s.split("\n")){
if(l&&*l=='#')
rv~=f(l[1..$]);
else
rv~=l;
}
return rv;
}
Example2:
invariant string s(string code){
return mixin(code);//mixin exp
}
Report this item for cleanup