Skip to content

Instantly share code, notes, and snippets.

@trendsetter37
Created October 19, 2014 14:24
Show Gist options
  • Save trendsetter37/db8fbcb3ee741f1e3730 to your computer and use it in GitHub Desktop.
Save trendsetter37/db8fbcb3ee741f1e3730 to your computer and use it in GitHub Desktop.
Read text files into Clojure REPL
; This is to read files into repl for dev work
; You would replace println with your function
; That you would like to test on each line of
; the text file.
(defn do-stuff [file] ; file should be a string surrounded by double quotes
(with-open [rdr (clojure.java.io/reader file)]
(doseq [line (remove empty? (line-seq rdr))]
(println line))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment