   (-deref o))
 
 (defn set-validator!
-  "Sets the validator-fn for a var/ref/agent/atom. validator-fn must be nil or a
+  "Sets the validator-fn for an atom. validator-fn must be nil or a
   side-effect-free fn of one argument, which will be passed the intended
   new state on any state change. If the new state is unacceptable, the
-  validator-fn should return false or throw an exception. If the current state (root
-  value if var) is not acceptable to the new validator, an exception
-  will be thrown and the validator will not be changed."
+  validator-fn should return false or throw an Error. If the current state
+  is not acceptable to the new validator, an Error will be thrown and the
+  validator will not be changed."
   [iref val]
   (set! (.validator iref) val))
 

  (set! (.meta iref) (apply f (.meta iref) args)))

(defn reset-meta!
  "Atomically resets the metadata for a namespace/var/ref/agent/atom"
  [iref m]
  (set! (.meta iref) m))


  [a newval]
  (when-let [v (.validator a)]
    (when-not (v newval)
      (throw (js/Error. "Validator rejected reference state"))))
  (set! (.state a) newval)
  (-notify-watches a (.state a) newval)
  newval)

(defn swap!
  "Atomically swaps the value of atom to be:
