On 8 December 2014 at 21:17, Fluid Dynamics <a2093...@trbvm.com> wrote:
> On Monday, December 8, 2014 9:32:28 AM UTC-5, Las wrote:
>> […]
>> io/reader is not meant to be used solely as an input to edn/read.
>
>
> AFAICT, PushbackReader is substitutable anywhere a reader is expected, but
> apparently a plain unwrapped BufferedReader is not.

user=> (line-seq (java.io.PushbackReader. (io/reader (io/file ".bashrc"))))
ClassCastException java.io.PushbackReader cannot be cast to
java.io.BufferedReader  clojure.core/line-seq (core.clj:2955)

It works with the plain unwrapped BufferedReader that io/reader returns.

Unfortunately PushbackReader and BufferedReader are both classes
rather than interfaces and they both have methods that the other class
does not. So, there isn't a single good choice for what a "reader"
function in Clojure on the JVM should return.

Cheers,
Michał


>
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to