hi clojurians,

I wanted to transform string keys to keyword key so I coded that
thing ;-) :

(defn string2keyword [mapWithStringsAsKeys]
    (apply hash-map
        (mapcat (fn [_] (list (keyword (first _)) (frest _)))
mapWithStringsAsKeys)))

; mapcat  (1) apply fn to create (:key val) then (2) concat and (3)
apply hashmap creates the new map

is there a shorter way or a clojure fn to do that ?

thanks
Phil

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to