Skip to content

Instantly share code, notes, and snippets.

View paulosuzart's full-sized avatar

Paulo Suzart paulosuzart

View GitHub Profile
@paulosuzart
paulosuzart / ltm.clj
Created December 15, 2011 00:14 — forked from rafaelfelini/ltm.clj
Makes a clojure Map from a given coll.
(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}