Opens a writer on f, binds it to *out*, and evalutes body.
Anything printed within body will be written to f.
(defmacro with-out-writer
"Opens a writer on f, binds it to *out*, and evalutes body.
Anything printed within body will be written to f."
[f & body]
`(with-open [stream# (writer ~f)]
(binding [*out* stream#]
~@body)))
Comments top
No comments for with-out-writer. Log in to add a comment.