This file contains hidden or 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 ltm | |
"Makes a clojure map from a given collection. lst should have an even number of elements" | |
[lst] | |
(reduce merge | |
(map (fn [l] {(keyword (first l)) (second l) } ) (partition 2 lst)))) | |
;kudos to @paulosuzart | |
;user=> (ltm '(:a 1 :b 2 :c3 :d 4)) | |
;{:c3 :d, :b 2, :a 1} |