Since this one doesnβt really have a clear answer (all this mixes up with the comments for the first answer), here is its essence:
(with-open [r (reader "input.txt")] (doall (line-seq r)))
This will force the entire line of lines to read and close the file. Then you can pass the result of all this expression.
When working with large files, you may have problems with memory (saving the entire sequence of lines in memory) and that if it is recommended to invert the program:
(with-open [r (reader "input.txt")] (doall (my-program (line-seq r))))
In this case, you may or may not need to, depending on what my program returns and / or my program consumes a sequence lazily or not.
source share