3 ms·
> * Run regular code at run time - does this just error if you try to use const on something that depends on a runtime value? Yep. For example `const foo = std
by dom96 12y ago
> * Run regular code at run time - does this just error if you try to use const on something that depends on a runtime value?
Yep. For example `const foo = stdin.readLine()` would result in "Error: cannot evaluate at compile time: stdin".
As for your second point. I haven't used this feature personally but I have heard that the compiler will tell you exactly where these optimisations are applied. You can also disable these optimisations very easily during compilation.