Skip to content

Instantly share code, notes, and snippets.

@camdez
Created October 13, 2015 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camdez/39b2735bd9cf0791e649 to your computer and use it in GitHub Desktop.
Save camdez/39b2735bd9cf0791e649 to your computer and use it in GitHub Desktop.
(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