On Feb 21, 10:11 pm, Mark Volkmann <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---