ClojureDocs

Nav

Namespaces

reset!

clojure.core

Available since 1.0 (source)
  • (reset! atom newval)
Sets the value of atom to newval without regard for the
current value. Returns newval.
1 Example
user=> (def x (atom 10))
#'user/x

user=> @x
10

user=> (reset! x 20)
20

user=> @x
20
See Also

Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be...

Added by TimMc

Atomically sets the value of atom to newval if and only if the current value of the atom is identi...

Added by AtKaaZ

Creates and returns an Atom with an initial value of x and zero or more options (in any order): ...

Added by AtKaaZ

Atomically swaps the value of atom to be: (apply f current-value-of-atom args). Note that f may be...

Added by agarman

Sets the value of atom to newval. Returns [old new], the value of the atom before and after the r...

Added by agarman
0 Notes
No notes for reset!