     (let [oldstate state
           res (capture-derefed f this)
           derefed (-captured this)]
-      (when (not= derefed watching)
+      (when-not (arr-eq derefed watching)
         (._update-watching this derefed))
       (set! dirtyness clean)
       (when-not nocache?

  (-write writer (str "#<" s " "))
  (pr-writer (binding [*ratom-context* nil] (-deref a)) writer opts)
  (-write writer ">"))

;;; Atom



(declare ^:dynamic *ratom-context*)
(defonce cached-reactions {})
(defonce ^boolean debug false)
(defonce ^boolean silent false)
(defonce generation 0)
(defonce -running (clojure.core/atom 0))

(defn ^boolean reactive? []
  (not (nil? *ratom-context*)))


;;; Utilities

(defn running []
  (+ @-running
