 
 ;;; cursor
 
-(deftype RCursor [ratom path setter ^:mutable reaction]
+(deftype RCursor [ratom path setter ^:mutable reaction
+                  ^:mutable state ^:mutable watches]
   IAtom
   IReactiveAtom
 


  IWatchable
  (-notify-watches [this oldval newval]
    (-notify-watches (._reaction this) oldval newval))
  (-add-watch [this key f]
    (-add-watch (._reaction this) key f))
  (-remove-watch [this key]
    (-remove-watch (._reaction this) key))

  IHash
  (-hash [this] (hash [ratom path])))

    (if (nil? reaction)
      (set! reaction
            (if (satisfies? IDeref ratom)
              (make-reaction #(get-in @ratom path))
              (make-reaction #(ratom path))))
      reaction))

  (_peek [this]
    (binding [*ratom-context* nil]
      (-deref this)))

  (_set-state [this oldstate newstate]
    (when-not (identical? oldstate newstate)
      (set! state newstate)
      (when (some? watches)
        (-notify-watches this oldstate newstate))))

  IDeref
  (-deref [this]
    (let [oldstate state
          newstate (-deref (._reaction this))]
      (._set-state this oldstate newstate)
      newstate))

  IReset
  (-reset! [this new-value]
    (let [oldstate state]
      (._set-state this oldstate new-value)
      (setter path new-value)
      new-value))

  ISwap
  (-swap! [a f]
