After spending some time other this weekend getting started with Clojure
(using the excellent Setting Up Clojure for Mac OS X Leopard to guide me
through setting up my development environment), it still took me a bit longer than
expected to find a concise answer to reading in files, so here is a stab at collecting
some thoughts on that topic.
The simplest approach to reading in a file is to use simply use slurp.
The BufferedReader wraps the FileReader to provide a lazy interface to the file,
and line-seq allows us to treat the stream as
a list, while behind the scene it calls the readLine method on BufferedReader.
Modifying the above code you could write a generic function for reducing lines in a file.
It's a bit more compact, but probably you'd be using duck-streams.read-lines
because you were already using other duck-streams functionality (like
writing out files, append-spit
for appending to files).
There are many other approaches to reading in files in Clojure, but these should be enough to get started.