                                  (update-in-context context operation))
   )
 
+(defn context-op-builder 
+  "Creates an application-state operation builder based on the given 
+  context. In other words: returns a function that takes
+  a function that can evolve the context data. This function, when called,
+  returns a function that can do that operation in the larger context
+  of the application state."
+  [context] 
+  (fn [op & triggers] (path-operator context op triggers)))

(ns quiescent-model.state
  (:require [quiescent-model.events :as evt]))

(defn root-scope [app-state-atom]
  {
   :app-state-atom  app-state-atom
   :scope           []

              )
            [] path-seq)))

(defn context-data 
  "Get the data from the application state that is represented by an
  abstract context"
  [context]
  (let [state-atom (:app-state-atom context)
        path (data-path context)
        ]
    (get-in @state-atom path)))

(defn update-in-context 
  "Update the data represented by the context in the real application 
  state using the supplied operation (this operation is like swap!, but
  you don't have to know where the data is actually stored)."
  [context op]
  (let [state-atom (:app-state-atom context)
        path (data-path context)
        ]
