1.2.0 permalink Arrow_down_16x16
  • (set-val key val)
Return a state-monad function that assumes the state to be a map and
replaces the value associated with key by val. The old value is returned.

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/monads.clj:383 top

(defn set-val
  "Return a state-monad function that assumes the state to be a map and
   replaces the value associated with key by val. The old value is returned."
  [key val]
  (update-val key (fn [_] val)))
Vars in clojure.contrib.monads/set-val: defn fn key val
Used in 0 other vars

Comments top

No comments for set-val. Log in to add a comment.