Last active
December 25, 2015 23:39
-
-
Save earle/7058944 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; 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