A natural solution is to use zipmap :
(zipmap [:year :month :day] (clojure.string/split "2013-02-18" #"-")) ;= {:day "18", :month "02", :year "2013"}
For a small such card it is quite effective. For a larger map, you need zipmap use transients that are not currently available. There is a ticket for this in JIRA, with my patch attached: CLJ-1005 .
Of course, itβs simple enough to include the zipmap included with the transients in one own code base and use it in preference to the one located in clojure.core . This is a pretty important thing if you are holding large cards.
Code can be copied from a patch or from the main ClojureScript library, which uses transients in its zipmap ; here is a link to the source of ClojureScript from version 1844 (this particular function can be used in Clojure unchanged).
source share