So, I know that if I define const, Nim will evaluate everything that I assigned to it at compile time, so I could do something like this:
proc compileTimeCode: bool =
# Put code here
return true
const _ = compileTimeCode()
and then I can put my code in compileTimeCodeproc.
It works, but it seems messy, complicated, and unintuitive. It also requires more typing than necessary, and hard to drive up.
source
share