• (lazy-get map key not-found)
Like get, but doesn't evaluate not-found unless it is needed.

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:22 top

(defmacro lazy-get 
  "Like get, but doesn't evaluate not-found unless it is needed."
  [map key not-found]
  `(if-let [pair# (find ~map ~key)] 
       (val pair#)
     ~not-found))
Vars in clojure.contrib.map-utils/lazy-get: defmacro key map apply concat find if-let list seq val vector
Used in 0 other vars

Comments top

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