Created
October 13, 2015 20:13
-
-
Save camdez/39b2735bd9cf0791e649 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 table [cols vals] | |
(->> vals | |
(partition (count cols)) | |
(map (partial zipmap cols)))) | |
(defn table2 [cols & rest] | |
(map (partial zipmap cols) rest)) | |
(table | |
[:this :that :another] | |
[1 2 3 | |
4 5 6]) | |
(table2 | |
[:this :that :another] | |
[1 2 3] | |
[4 5 6]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment