;; to get an index of the element of a vector, use .indexOf user=> (def v ["one" "two" "three" "two"]) #'user/v user=> (.indexOf v "two") 1 user=> (.indexOf v "foo") -1
(defn get
"Returns the value mapped to key, not-found or nil if key not present."
{:inline (fn [m k & nf] `(. clojure.lang.RT (get ~m ~k ~@nf)))
:inline-arities #{2 3}
:added "1.0"}
([map key]
(. clojure.lang.RT (get map key)))
([map key not-found]
(. clojure.lang.RT (get map key not-found))))
Comments top
No comments for get. Log in to add a comment.