I have a vector that looks like this:
["Config" "{}" "Auth" "{}" "Other" "{}"]
I'd like to take each key value pair and turn it into the following map:
{"Config" "{}", "Auth" "{}", "Other" "{}"}
How can I do this with Clojure? Is there a built in function that does this?
Use apply
to apply the map constructor of desired type to the vector, ie :
(apply hash-map ["Config" "{}" "Auth" "{}" "Other" "{}"])
edit
According to this answer you can get different map types depending on the way you evaluate {}
, so use the map constructor suitable to your needs.
edit
Looking at this the different object types returned by literal {}
appears to be a bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With