It has to be in a single function. Suppose you have a variety of modules each of which has a variety of types. And you need to compose a compile-time string which involves all those types and you need to mix that string in at some point. You can't do that.


On Tue, Nov 27, 2012 at 4:33 PM, Jacob Carlborg <doob@me.com> wrote:
On 2012-11-27 12:28, Gor Gyolchanyan wrote:
Basically the most important thing I miss is mutable compile-time
variables. That's it. Everything else can be worked around.

This compiles just fine and prints "10" at compile time:

int foo ()
{
    int i = 0;
    for (; i < 10; i++) {}
    return i;
}

enum i = foo();
pragma(msg, i);

--
/Jacob Carlborg



--
Bye,
Gor Gyolchanyan.