How to read lines from stdin (*in*) in clojure

后端 未结 4 1976
情歌与酒
情歌与酒 2020-12-13 13:09

I am writing my first clojure program, and want to read lines from stdin.

When I try this:

(doall (map #(println %) (line-seq *in*)))
4条回答
  •  悲哀的现实
    2020-12-13 13:42

    Just a note that for anyone who wants to only read a single line, there's the read-line function.

提交回复
热议问题