On Fri, Aug 27, 2010 at 13:54, Daniel Janus <nath...@gmail.com> wrote:

> Hi,
>
> so I finally got around to port my app to Clojure 1.2 and got confused
> about the contrib shuffles.
>
> There's clojure.java.io and clojure.contrib.io. The docs on the latter
> says that most of the functions defined in there are deprecated, and
> one should use clojure.java.io instead. But clojure.java.io lacks some
> of the very useful macros and function I'm using, like with-in-reader,
> with-out-writer, slurp*, to name but a few; clojure.contrib.io does
> have them, but it relies on its own primitives, instead of building on
> clojure.java.io. So in a way I'm committed to using (if indirectly)
> code that is already deprecated. What are the plans for contrib
> development in this case?
>
>
with-out-writer and with-in-reader do indeed seem to be missing. By hand,
this would be e.g.

(with-open [r (io/reader x)]
  (binding [*in* r]
    (read)))

But that seems like the kind of boiler-plate a macro or function should be
provided for...


> On a side note: shouldn't slurp* and slurp be unified somehow in a
> future release?
>

The slurp in clojure 1.2 core
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/slurp
now properly supports encoding by passing :encoding. For example:

(slurp path :encoding "UTF-8")


> Also, contrib 1.2's str-utils contains the following confusing comment
> at the very top:
>
> ;; DEPRECATED in 1.2: Promoted to clojure.java.string. Note that
> ;; many function names and semantics have changed
>
>
I believe clojure.string (in Clojure 1.2.0) is what was meant.


> whereas there's no such thing as clojure.java.string.
>
> Daniel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com<clojure%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to