You're viewing version 1.2.0 of reset!. The latest stable version of Clojure Core is 1.3.0.
1.2.0 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:1802 top

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

Comments top

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