If your keys were keywords, e.g. :key1, you could simply map them as
they are also functions:
(map :key1 ({:key1 "value1"} ...)
U
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that
On Wed, Apr 20, 2011 at 4:24 AM, Dave wrote:
> The only way I could think of to do it is
>
> (for [i (range (count(myvec)))] ((nth myvec i) "key1"))
>
> Is there an easier way? It seems like there must be.
There is! (in fact there could be many ways)
(vec (map #(% "key1") myvec))
;=> ["value1" "