 
    (-/p (xpand form1 {:name "name1" :ns "ns1"} ))
 
+   (-/p (eval (xpand form1 {:name "name1" :ns "ns1"} )))
+
    (def form2 '(str (inc 1) 3))
 
    (-/p (xpand form2 {:name "name1" :ns "ns1"} ))
 
-   (-/p (eval (xpand form1 {:name "name1" :ns "ns1"} )))
+   (-/p (eval (xpand form2 {:name "name1" :ns "ns1"} )))
+
+   (def form3 '(if 1 2 3))
+
+   (-/p (xpand form3 {:name "name1" :ns "ns1"} ))
+
+   (-/p (eval (xpand form3 {:name "name1" :ns "ns1"} )))
+
 
    (comment))
 

(declare produce-recent-parent-tree-atom!)

(defn get-recent-tree-at-inner-path
  [path recent-trees]
  (let [entry (@recent-trees path)]
    (if (not (some->> entry
                      deref
                      keys
                      (some #{:return :throw})))
      entry
      nil)))

(defn assoc-to-recent-trees!
  [tree-atom parent-tree-atom recent-trees]
  (swap! recent-trees
         assoc
         (:inner-path @tree-atom)
         tree-atom)
  (when parent-tree-atom
    (println "vvvvv")
    #spy/d tree-atom
    #spy/d parent-tree-atom
    (println "^^^^^")
    (clojure.stacktrace/print-stack-trace (Exception. "assoc-to-recent-trees!"))
    (swap! (-> @parent-tree-atom
               :inner-path
               (@recent-trees)
               deref
               :children)
           conj
           tree-atom)))

(defn mk-recent-tree-at-inner-path
  [inner-path recent-trees]
  (if (nil? inner-path)
    (let [new-parent (get-temp-root-parent)]
      (assoc-to-recent-trees! new-parent
                              nil
                              recent-trees)
      new-parent)
    (let [new-grandparent (produce-recent-parent-tree-atom! inner-path
                                                            recent-trees)
          new-parent (-> (trace/mk-tree :parent new-grandparent)
                         (assoc :inner-path inner-path
                                :parent-path (:path new-grandparent))
                         atom)]
      (assoc-to-recent-trees! new-parent
                              new-grandparent
                              recent-trees)
      new-parent)))

(defn produce-recent-tree-atom!
  [inner-path recent-trees]
  (if-let [tree-atom (get-recent-tree-at-inner-path inner-path
                                                    recent-trees)]
    tree-atom
    (mk-recent-tree-at-inner-path inner-path
                                  recent-trees)))


(defn record-trace-tree
  [[log src-map]]
  #spy/d (@log nil)
  (def log' @log)
#_  (loop [[head & body] log
         tree-map {}
