   (dosync (alter @#'clojure.core/*loaded-libs* disj lib)))
 
 (defn reload-one
-  "Executes one unload/reload operation; returns updated dependency
-  tracker indicating errors and which namespaces remain to be
-  removed/reloaded."
+  "Executes the next pending unload/reload operation in the dependency
+  tracker. Returns the updated dependency tracker. If reloading caused
+  an error, it is captured as :error."
   [state]
   (let [{:keys [unload load]} state]
     (cond

                     load)))))

(defn add-files
  "Reads ns declarations from files; returns an updated dependency
  tracker indicating which namespaces need to be reloaded after files
  were added."
  [state files]
  (let [{:keys [depmap filemap]}
        (reduce (fn [m file]

   :load ()})

(defn add
  "Returns an updated dependency tracker with new/updated namespaces.

  Depmap is a map describing the new or modified namespaces. Keys in
  the map are namespace names (symbols). Values in the map are sets of
  symbols naming the birect dependencies of each namespace. For
  example, assuming these ns declarations:

      (ns alpha (:require beta))
      (ns beta (:require gamma delta))

  the depmap would look like this:

      {alpha #{beta}
       beta  #{gamma delta}}

  After adding new/updated namespaces, the dependency tracker will
  have two lists:

      :unload is the list of namespaces that need to be removed

      :load is the list of namespaces that need to be reloaded

  To reload namespaces in the correct order, first remove/unload all
  namespaces in the :unload list, then (re)load all namespaces in
  the :load list.
"
  [state depmap]
  (let [{:keys [load unload deps nsmap]} state
        new-deps (update-deps deps depmap)
