On Feb 12, 12:53 pm, Phil Hagelberg <p...@hagelb.org> wrote:
> I'd expect to be able to do (read (reader my-file)), but this isn't OK
> because read needs a java.io.PushbackReader. It seems vaguely wrong
> somehow to have a function called "reader" return something that cannot
> be "read" from.

I could change "duck-streams/reader" to return a PushbackReader
instead of a BufferedReader.  Unfortunately, "readLine" is defined in
BufferedReader but NOT in PushbackReader.  We need "readLine" for
"clojure.core/line-seq".  So we can't have it both ways.  Blame Java's
over-engineered I/O.

Another alternative is to provide a "duck-streams/read*" to wrap
"clojure.core/read" and handle the type conversions.

-Stuart Sierra
--~--~---------~--~----~------------~-------~--~----~
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
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