       )
 
 
-
      (def src '(defn f1 [a] (let [[b] [4 5]] {a (-> a (+ b) dec)})))
+
      '(def f1 (fn* ([a]
                     (let* [vec__21418 [4 5]
                            b (clojure.core/nth vec__21418 0

                  (swap-in-path-syms
                   (clojure.walk/macroexpand-all src)))

     (swap-in-path-syms
      (clojure.walk/macroexpand-all src)))

  `(alter-meta! ~body assoc :source '~body))

(defn back-into
  "Puts the contents of `noob` into a collection of the same type as `orig`."
  [orig noob]
  ((if (seq? orig)
     reverse
     identity)
   (into (or (empty orig)
             [])
         noob)))

(defn swap-in-path-syms
  [form & [path]]
  (cond
    (special-operator? form) form
    (coll? form)  (back-into form
                             (doall (map-indexed #(swap-in-path-syms %2
                                                                     (conj (or (not-empty path)
                                                                               [])
                                                                           %))
                                                 form)))
    :else (symbol (apply str
                         "___"
                         (clojure.string/join "-"
                                              path)))))

(defn deep-zipmap-no-colls
       [a b]
       (zipmap (filter (comp not coll?) (tree-seq coll? seq a))
               (filter (comp not coll?) (tree-seq coll? seq b))))


(defn deep-zipmap
       [a b]
       (zipmap (tree-seq coll? seq a)
               (tree-seq coll? seq b)))


(defn get-path->form-maps
  [src]
  (let [sx #spy/d (-> src swap-in-path-syms clojure.walk/macroexpand-all)
        sx-seq #spy/d (->> sx
                           (tree-seq list? seq)
                           (filter list?))
        pair-fn (fn [form]
                  (interleave (seq #spy/d form)
                              (repeat form)))]
    (apply hash-map
           #spy/d (mapcat pair-fn
                          sx-seq))))

(clojure.pprint/pprint (get-path->form-maps '(a (b 1) c)))

(defn mk-expr-mapping
  [src]
  (let [xs->sx (deep-zipmap-all (-> src clojure.walk/macroexpand-all swap-in-path-syms)
                                (-> src swap-in-path-syms clojure.walk/macroexpand-all))
        xs->x  (deep-zipmap-all (-> src clojure.walk/macroexpand-all swap-in-path-syms)
                                (-> src clojure.walk/macroexpand-all))
        s->o (deep-zipmap (-> src swap-in-path-syms)
                          src)
        sx->s (get-path->form-maps src)
        f (fn [k]
            {k {:xs k
                :sx (get xs->sx k)
                :x  (get xs->x k)
                :s (->> k
                        (get xs->sx)
                        (get sx->s))
                :o (->> k
                        (get xs->sx)
                        (get sx->s)
                        (get s->o))}})]
    (apply merge (map f (keys xs->sx)))))

(clojure.pprint/pprint (mk-expr-mapping '(a b c)))

#_ (do


