Writes lines (a seq) to f, separated by newlines. f is opened with
writer, and automatically closed at the end of the sequence.
(defn write-lines
"Writes lines (a seq) to f, separated by newlines. f is opened with
writer, and automatically closed at the end of the sequence."
[f lines]
(with-open [^BufferedWriter writer (writer f)]
(loop [lines lines]
(when-let [line (first lines)]
(.write writer (str line))
(.newLine writer)
(recur (rest lines))))))
Comments top
No comments for write-lines. Log in to add a comment.