Closed muzzel closed 9 years ago
Why not something like this?
function bla()
if compiletime
doSomething()
else
doSomethingElse()
I am planning to add something like compiletime
as a built-in constant, see discussion in #365
Yea that works too, just thought it might be comfortable.
But I didnt notice that it completely destroys readability (similar to vJass hooks), so its a bad idea anyway.
Idea: add an annotation that allows the user to define a replacement for a function, which is used when the function is executed in compiletime.
Example:
When
bla()
is executed during runtime, the normaldoSomething()
version is used. Ifbla()
is executed in compiletime, thedoSomethingElse()
version is used. If there is no@compiletimereplacement
defined for a function, the normal version is used for both runtime and compiletime.Someone should probably come up with a shorter name for the annotation :p