Last active
August 12, 2019 16:52
-
-
Save the-frey/a1e0fbebecd67b009b689a864ef8eec4 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
;; example vector | |
(def test-vec [["1" "foo"]["2" "bar"]]) | |
;; via reduce, the verbose way | |
(reduce (fn [acc i] (assoc acc (first i) (second i))) {} test-vec) | |
;; also via reduce, the terse way | |
(reduce conj {} test-vec) | |
;; via a handy built-in | |
(into {} test-vec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment