(defn heredoc [] (let [delim (.readLine *in*)] (->> (repeatedly #(.readLine *in*)) (take-while #(not= delim %)) (interpose \newline) (apply str)))) ; The following lines are read (by the reader) as: ; "Look )(\"\\T\na here doc!\n" #=(heredoc)""" Look )("\T a here doc! """