I missed your reply, Raek. Sorry. Your solution is very helpful.
Cheers,
Simon
> From what I can tell, you want to list the values and extract the
> value associated with :time for a map. The problem is that res is not
> a map, but a vector of maps. If you want to do these operations on
> every map in the vector you can use the map function ("map" as in "to
> map"):
>
> (map vals res)
>
> (map :time res)
>
> In the last example I made use of the fact that keywords also work as
> functions. (:some-keyword some-map) is the same as (get some-map
> :some-keyword).
>
> To play in the repl with the first value in the vector in the repl you
> can extract it with nth or get:
>
> user> (def res ...)
> #'res
> user> (def first-res (nth res 0))
> #'first-res
> user> (vals first-res)
> ...
> user> (get first-res :time)
> ...
>
> // raek
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
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