• (slurp* f)
Like clojure.core/slurp but opens f with 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/duck_streams.clj:247 top

(defn ^String slurp*
  "Like clojure.core/slurp but opens f with reader."
  [f]
  (with-open [^BufferedReader r (reader f)]
      (let [sb (StringBuilder.)]
        (loop [c (.read r)]
          (if (neg? c)
            (str sb)
            (do (.append sb (char c))
                (recur (.read r))))))))
Vars in clojure.contrib.duck-streams/slurp*: char defn let loop neg? str with-open
Used in 0 other vars

Comments top

No comments for slurp*. Log in to add a comment.