Skip to content

Instantly share code, notes, and snippets.

@metaperl
Created February 17, 2010 02:42
Show Gist options
  • Select an option

  • Save metaperl/306231 to your computer and use it in GitHub Desktop.

Select an option

Save metaperl/306231 to your computer and use it in GitHub Desktop.
Clojure FAQ
Is there a way to retrieve more then one keys value from a hash?
(let [a {:one 1 :two 2}] (a :one :two))
[21:40] fanatico: ,(let [a {:one 1 :two 2}] (map a [:one :two]))
[21:40] clojurebot: (1 2)
[21:41] hiredman: ,(let [{:keys [a b]} {:a 1 :b 2}] [a b])
[21:41] clojurebot: [1 2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment