store/[org.clojure/clojure "1.8.0"] clj::clojure.core/alter-var-root

Official Documentation

Add notes
Arities
==================================================
   [v f & args]

Docstring
==================================================
  Atomically alters the root binding of var v by applying f to its
  current value plus any args

Source

(defn alter-var-root
  "Atomically alters the root binding of var v by applying f to its
  current value plus any args"
  {:added "1.0"
   :static true}
  [^clojure.lang.Var v f & args] (.alterRoot v f args))

Example 1

Edit
(defn sqr [n] 
  "Squares a number"
  (* n n))
;; => #'user/sqr

(sqr 5)
;; => 25

(alter-var-root 
 (var sqr)                     ; var to alter
 (fn [f]                       ; fn to apply to the var's value
   #(do (println "Squaring" %) ; returns a new fn wrapping old fn
        (f %))))

(sqr 5)
;; > Squaring 5
;; => 25

Uses on crossclj