• (safe-get map key)
Like get, but throws an exception if the key is not found.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/contrib/map_utils.clj:29 top

(defn safe-get 
  "Like get, but throws an exception if the key is not found."
  [map key] 
  (lazy-get map key 
   (throw (IllegalArgumentException. (format "Key %s not found in %s" key map)))))
Vars in clojure.contrib.map-utils/safe-get: defn format key map
Used in 0 other vars

Comments top

No comments for safe-get. Log in to add a comment.