Create a reader from reader-spec, run the monadic I/O statement
on it, and close the reader. reader-spec can be any object accepted
by clojure.contrib.io/reader.
(defn with-reader
"Create a reader from reader-spec, run the monadic I/O statement
on it, and close the reader. reader-spec can be any object accepted
by clojure.contrib.io/reader."
[reader-spec statement]
(with-open [r (reader reader-spec)]
(first (statement (lock r)))))
Comments top
No comments for with-reader. Log in to add a comment.