 (defn sub-cursor
   "takes a path and existing cursor and returns a cursor
    scoped to that path"
-  [cursor path]
-  (let [db cursor]
+  [cursor & path-parts]
+  (let [db cursor
+        path (build-path path-parts)]
     (reify
+      IPath
+      (-path [this] path)
+      
       IReadable
       (-read [_  sub-path]
         (read cursor (concat path sub-path)))

(defprotocol IReadable
  (-read [this path]))

(defn read [store path]
  (when *component*
    (register-path *component* store path))
  (-read store path))


(defprotocol ITransact

(defn store [obj]
  (-store obj))


(defprotocol IPath
  (-path [this]))

(defn path [obj]
  (-path obj))


(defprotocol INotify
  (-notify [this path]))

