! impure

conventionsince v0.0-927 in clojureEdit

A naming convention sometimes applied to functions that perform mutations. Examples:


In Clojure, it is used only for things not safe in an STM transaction (source), which does not apply to ClojureScript because its compilation target, JavaScript, is single-threaded.


The following causes a side-effect in the state of a:

(def a (atom 1))
;;=> 1

(reset! a 2)
;;=> 2

See Also: