-
-
Save kanwei/e2c0415eb118ee79e4f1 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
(defn process-game | |
([lines] (process-game lines {})) | |
([lines game] | |
(if-let [[op & data] (first lines)] | |
(case op | |
("id" "version") (recur (rest lines) (assoc game op (first data))) | |
"info" (recur (rest lines) (assoc-in game [:info (first data)] (second data))) | |
(recur (rest lines) game)) | |
game))) | |
(time (pmap process-game (extract-games (parse-csv (clojure.java.io/reader "2012WAS.EVN"))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment