Hi,

there are various ways to retrieve the value:

(def m {:x 1, :y {"a" "b"}, :z #<String[] [Ljava.lang.String;@1f139b7>})

Useful if m might be nil:
(get m :z)
(get m :z some-default-if-not-found)

If you know m is always non-nil the following is sometimes useful eg. with 
other HOFs like map etc.
(m :z)
(m :z some-default-if-not-found)

If you know the your key is a keyword (as in this case) you also put the key 
in front.
(:z m)
(:z m some-default-if-not-found)

This does not work if your keys are for example Strings.
("z" m) ; <= does *not* work

For vectors the same works except that the keys are always integers.

Hope this helps.

Sincerely
Meikel

-- 
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 posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to