-- tests/comptime.cat -- compile-time evaluation (Zig-style). -- -- `comptime ""` runs catscript IN the compiler, in an embedded -- VM, and uses the result. In an expression it becomes a constant; as a -- statement it runs for side effects (compile-time globals). -- expression position: the value is baked into the program as a constant local x = comptime "return 6 * 7" print("ct-expr:", x) -- compile-time string building local s = comptime "return \"hi \" .. \"there\"" print("ct-text:", s) -- statement position: side effects, discard the value comptime "done = true" print("after-ct")