Possible duplicate:What is the easiest way to parse URL parameters in Clojure?
I would like to take a line like:
"Q = foo + bar & x = 14 & y = hello"
and turn it into a map like:
{: q "foo + bar" ,: x 14 ,: y "hello"}
I am sure that for such a problem there is an elegant idiomatic solution.
(->> (split "q=foo+bar&x=14&y=hello" #"&") (map #(split % #"=")) (map (fn [[kv]] [(keyword k) v])) (into {}))