Skip to content

Instantly share code, notes, and snippets.

@quux00
Created October 2, 2012 02:01
Show Gist options
  • Save quux00/3815736 to your computer and use it in GitHub Desktop.
Save quux00/3815736 to your computer and use it in GitHub Desktop.
Example of how to read from STDIN in a Clojure program
(ns example.stdin)
(defn -main
"Read from STDIN"
[& args]
(println "Enter text:")
(loop [input (read-line)]
(when-not (= ":done" input)
(println (str "You entered: >>" input "<<"))
(recur (read-line))))
(println "End"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment