       (thunk)
       (finally
         (when (not= id -1)
-          (dosync
-            (commute *repls* assoc id
-                     (struct-map repl
-                                 :id                 id
-                                 :ns                 *ns*
-                                 :warn-on-reflection *warn-on-reflection*
-                                 :print-meta         *print-meta*
-                                 :print-length       *print-length*
-                                 :print-level        *print-level*
-                                 :compile-path       *compile-path*
-                                 :command-line-args  *command-line-args*
-                                 :expr1              *1
-                                 :expr2              *2
-                                 :expr3              *3
-                                 :exception          *e
-                                 :print-pretty       vimclojure.repl/*print-pretty*
-                                 :line               (dec (.getLineNumber *in*))))))
-        (Var/popThreadBindings)))))
+          (swap! *repls* assoc id
+                 (struct-map repl
+                             :id                 id
+                             :ns                 *ns*
+                             :warn-on-reflection *warn-on-reflection*
+                             :print-meta         *print-meta*
+                             :print-length       *print-length*
+                             :print-level        *print-level*
+                             :compile-path       *compile-path*
+                             :command-line-args  *command-line-args*
+                             :expr1              *1
+                             :expr2              *2
+                             :expr3              *3
+                             :exception          *e
+                             :print-pretty       vimclojure.repl/*print-pretty*
+                             :line               (dec (.getLineNumber *in*))))))
+        (Var/popThreadBindings))))
 
 (defmacro with-repl
   "Executes body in the context of the Repl with the given id. id may be -1

  ; Make sure user namespace exists.
  (let [id       (repl-id)
        the-repl (make-repl id nspace)]
    (dosync (commute *repls* assoc id the-repl))
    id))

(defn stop
  "Stop the Repl with the given id."
  [id]
  (dosync
    (when-not (@*repls* id)
      (throw (Exception. "Not Repl of that id or Repl currently active: " id)))
    (commute *repls* dissoc id)))

(defn root-cause
  "Drill down to the real root cause of the given Exception."

  #^{:doc
  "A map holding the references to all running repls indexed by their repl id."}
  *repls*
  (atom {}))

(let [id (atom 0)]
  (defn repl-id
    "Get a new Repl id."
    []
    (swap! id inc)))

(def
  #^{:doc
