                             path')))
     form))
 
-;; TODO should take coll of forms?
 (defn xpand
   [form parent-fn-meta]
   (let [expr-map (mk-expr-mapping form)]

             (tree1->trace-tree trace/*trace-log-parent*
                                src-map))))

;;TODO trace multi-arity works??
(defn deep-tracer
  [{:keys [workspace qual-sym meta' ns']} original-fn] ;; original-fn and workspace not used! IS THAT RIGHT??
  (let [src (-> qual-sym
                symbol
                util/hunt-down-source)
        xsrc (clojure.walk/macroexpand-all src)
        get-fn (fn [[d s f & r]] (if (and (= d 'def)
                                          (symbol? s)
                                          (-> f nil? not)
                                          (nil? r))
                                   (throw (Exception. (format "Expected a defn form, but got this (%s %s ..."
                                                              d s)))))
        traced-form  (get-fn (xpand src meta'))]
    (util/eval-in-ns (-> ns' str symbol)
                     traced-form)))

 #_ (-> #spy/d (xpand '(let [a 1
                         b 2]
                     (if false
                       a
                       b)))
           eval)

#_ (binding [trace/*trace-log-parent* (trace/mk-tree :id-prefix "root" :parent {})]
     (def tree trace/*trace-log-parent*)
     (-> (xpand '(let [a 1]
                   (-> a
                       inc
                       dec
                       nil?))
                {:name "ofunc" :ns "ns1"})
         eval))

#_ (binding [trace/*trace-log-parent* (trace/mk-tree :id-prefix "root" :parent {})]
     (def tree trace/*trace-log-parent*)
     (-> #spy/d (xpand
                 '(if (= 1 2) 3 4))
         eval))


#_  (-> (xpand )
           eval)


#_ (do

     #spy/d (-> (xpand '(let [a 1
                         b 2]
                     (if false
                       a
                       b)))
           eval)

     (comment))

       (record-trace-tree ~'$$)
       ~'$return)))

(defn xpand-bod
  [fn-bod parent-fn-meta]
  (cons (first fn-bod)
        (map #(xpand % parent-fn-meta)
             (rest fn-bod))))

(defn xpand-fn*
  [form parent-fn-meta]
  (let [bods (->> form
                  rest
                  (map #(xpand-bod % parent-fn-meta)))]
    (cons (first form)
          bods)))

(defn log->tree1
  [log src-map fn-meta]
