(defn stream-repl
"Repl entry point that provides convenient overriding of input, output,
and err streams via sequential keyword-value pairs. Default values
for :in, :out, and :err are streams associated with System/in,
System/out, and System/err using UTF-8 encoding. Also supports all the
options provided by clojure.contrib.repl-ln/repl."
[& options]
(let [enc RT/UTF8
{:keys [in out err]
:or {in (LineNumberingPushbackReader.
(InputStreamReader. System/in enc))
out (OutputStreamWriter. System/out enc)
err (PrintWriter. (OutputStreamWriter. System/err enc))}}
(apply hash-map options)]
(binding [*in* in *out* out *err* err]
(apply repl options))))
Used in 0 other vars
Comments top
No comments for stream-repl. Log in to add a comment.