I've got a problem where I have a reader (it's a java.io.BufferedReader
that came from duck-streams, if that matters at all) and I want to call
"read" on it.

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 took a look at what could be done to fix this. I looked at the clj
definition of read, but it looks like you'd have to turn it into a
multimethod to make it accept readers that aren't PushbackReaders. Since
read is such a fundamental function, this seems ill-advised. But it
looks to me that you could also solve this problem by adding a method to
clojure.lang.LispReader that could accept other kinds of readers and
wrap them in a PushbackReader without modifying any existing code.

Does this seem like a decent idea? I'm fine if the correct answer is
just "quit your whining, it's not that bad", but I'd like to know if I'm
the only person this bothers--at least in that case I can attempt to
adjust my aesthetics. =)

-Phil

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