1.2.0 permalink Arrow_down_16x16
  • (stream-repl & options)
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.

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/repl_ln.clj:119 top

(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))))
Vars in clojure.contrib.repl-ln/stream-repl: apply binding defn let
Used in 0 other vars

Comments top

No comments for stream-repl. Log in to add a comment.