I've been playing with string mixins, and they are very powerful.

One thing I can't figure out is what exactly can and cannot be evaluated at compile time.

For example:

----
char[] myFunc1() {
        return "int a = 1;";
}

char[] myFunc2() {
        char[] myFunc3() {
                return "int b = 2;";
        }
        return myFunc3();
}

void main() {
        mixin(myFunc1());
        mixin(myFunc2());
}
----

myFunc1() can be used as a string mixin.
myFunc2() can't be.

I'm sure there are other things that I'll run into, but I figure there is some simple set of rules of what can and can't be used as a string mixin.

Reply via email to