• (with-writer writer-spec statement)
Create a writer from writer-spec, run the monadic I/O statement
on it, and close the writer. writer-spec can be any object accepted
by clojure.contrib.io/writer.

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:90 top

  (defn with-writer
    "Create a writer from writer-spec, run the monadic I/O statement
     on it, and close the writer. writer-spec can be any object accepted
     by clojure.contrib.io/writer."
    [writer-spec statement]
    (with-open [w (writer writer-spec)]
      (first (statement (lock w)))))
Vars in clojure.contrib.monadic-io-streams/with-writer: defn first with-open
Used in 0 other vars

Comments top

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