1.3.0 permalink Arrow_down_16x16

reset!

clojure.core

  • (reset! atom newval)
Sets the value of atom to newval without regard for the
current value. Returns newval.

1 Example top

  • user=> (def x (atom 10))
    #'user/x
    
    user=> @x
    10
    
    user=> (reset! x 20)
    20
    
    user=> @x
    20
    
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:2119 top

(defn reset!
  "Sets the value of atom to newval without regard for the
  current value. Returns newval."
  {:added "1.0"
   :static true}
  [^clojure.lang.Atom atom newval] (.reset atom newval))
Vars in clojure.core/reset!:
Used in 0 other vars

Comments top

No comments for reset!. Log in to add a comment.