Clojure: Convert hash-maps key strings to keywords?

You can also use the clojure.walk library to achieve the desired result with the function keywordize-keys

(use 'clojure.walk)
(keywordize-keys {"name" "Tylenol", "how" "instructions"})
;=> {:name "Tylenol", :how "instructions"}

This will walk the map recursively as well so it will “keywordize” keys in nested map too

http://clojuredocs.org/clojure_core/clojure.walk/keywordize-keys

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)