Skip to content

Instantly share code, notes, and snippets.

@earle
Last active December 25, 2015 23:39
Show Gist options
  • Save earle/7058944 to your computer and use it in GitHub Desktop.
Save earle/7058944 to your computer and use it in GitHub Desktop.
; data.txt contains lines of numbers separated by spaces
; add up the numbers on each line and print
(with-open [rdr (io/reader "resources/data.txt")]
(doseq [line (line-seq rdr)]
;(println (apply + (map read-string (string/split line #"\s+"))))))
(println (apply + (map read-string (re-seq #"\d+" line))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment