include a file variably

2021-06-27 Thread stbalbach
Thank you.

include a file variably

2021-06-27 Thread juancarlospaco
when defined(yourSwitch): include module

include a file variably

2021-06-27 Thread stbalbach
I would like to "include" a source file variably, such as based on an argument to the program via the command-line, or a compile-time switch. Is there a way to do so? I suspect the former is not possible but maybe the second. Example main.nim if : include myfile.nim

include a file variably

2021-06-27 Thread ElegantBeef
You can do `when defined(useSomeModule): include myFile` then when compiling from the command line do `-d:useSomeModule`. [When](https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement) is explained here.