On Feb 21, 10:11 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
> (print "Enter your name: ")
> (flush)
> (def nm (read-line))
> (newline)
> (println "Your name is" nm)
>
> The read-line throws java.lang.ClassCastException:
> clojure.lang.LineNumberingPushbackReader.
> Should it do that? I just want to read from stdin.

You could try getting a BufferedReader from System/in:

(binding [*in* (java.io.BufferedReader.
                 (java.io.InputStreamReader. System/in))]
  (read-line))

But it's probably simpler to write:

(.readLine *in*)

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