   (swap! tracker assoc ::track/load nil ::track/unload nil)
   (println :ok))
 
-(defn recover-state [repl-env analyzer-env repl-opts state]
-  (eval-form repl-env
-             analyzer-env
-             repl-opts
-             `(set! ~state (.-tire_iron_state_ js/goog))))
-
-(defn print-state [repl-env analyzer-env repl-opts]
-  (println
-    (eval-form repl-env
-               analyzer-env
-               repl-opts
-               `(.-tire_iron_state_ js/goog))))
-
 (defn maybe-quoted->symbol [symbol-or-list]
   (if (list? symbol-or-list)
     (second symbol-or-list)

           "  throw new Error(\"Cannot resolve symbol: " sym "\");\n"
           "}\n"))))

(defn set-ti-state-from-sym-script [state-sym]
  (let [state-sym (comp/munge state-sym)]
    (when-not (str/blank? (str state-sym))
      (str "if (" (object-path-exists? state-sym) ") {\n"
           "  goog.tire_iron_state_ = " state-sym ";\n"
           "} else {\n"
           "  throw new Error(\"Cannot resolve :state symbol: " state-sym "\");\n"
           "}\n"))))

(defn set-sym-from-ti-state-script [state-sym]
  (let [state-sym (comp/munge state-sym)]
    (when-not (str/blank? (str state-sym))
      (str "if (" (parts-exist? (butlast (object-path-parts state-sym))) ") {\n"
           "  " state-sym " = goog.tire_iron_state_;\n"
           "} else {\n"
           "  throw new Error(\"Cannot resolve :state symbol: " state-sym "\");\n"
           "}\n"))))

(defn compile-unload-ns [ns]
  (let [ns (comp/munge ns)
        loaded-libs (comp/munge 'cljs.core/*loaded-libs*)]
    (str "(function(){\n"
         "var ns, ns_string, path, key, value;\n"
         "ns_string = \"" ns "\";\n"
         "path = goog.dependencies_.nameToPath[ns_string];\n"
         "goog.object.remove(goog.dependencies_.visited, path);\n"
         "goog.object.remove(goog.dependencies_.written, path);\n"

                             :analyzer-env analyzer-env
                             :repl-opts repl-opts}))))

     'print-disabled
     (wrap (fn [& _]
             (prn :disabled-unload @disable-unload)
