Is there a way to read a file line by line at compile time?
My use case is that I want to process an input file and produce Nim code via macros, but have no trace of the input file in the resulting binary. Basically, I just want to iterate over the lines and throw them away after the VM has read them.
Like this:
import strutils
macro r: untyped =
for l in "input".slurp.splitLines:
# process a line
echo l
r()