I compiled following content with: nim c -r --define:line:10 foo.nim but I got: foo.nim(2.9) Error: undeclared identifier: 'line'
How can I access the line variable? or Am I doing something wrong?
when defined(line):
echo line
Thanks
--define with a value can only be used to overwrite constants.
nim c -r --define:line=10 foo.nim
when defined(line):
const line {.intdefine.} = 84
echo line