• (with-reader reader-spec statement)
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.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/monadic_io_streams.clj:82 top

  (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)))))
Vars in clojure.contrib.monadic-io-streams/with-reader: defn first with-open
Used in 0 other vars

Comments top

No comments for with-reader. Log in to add a comment.