nimja
nimja copied to clipboard
Const vars can be optimized into string blocks
Const variables can be optimized if they're touching a string block, saving an add call
import macros
const foo = "foo baa"
macro dd(v: typed) =
when v is static:
echo "static!"
else:
echo "NON static!"
if v.symKind == nskConst:
echo "const!"
else:
echo "NON const"
dd(foo)
It seems this is a hard issue: https://forum.nim-lang.org/t/9283