                    (fix merge-deps
                         locals->closed-overs)))
 
-          (println @locals->closed-overs)
-
           (let [;; rewrite the bindings to share closed-over information
                 bindings' (mapv (partial rewrite-closed-overs
-                                         locals->closed-overs)
+                                         @locals->closed-overs)
                                 bindings)
 
                 fns       (zipmap (map pattern/binding->symbol bindings')


(defn rewrite-closed-overs
  [mapping binding]
  (let [name (pattern/binding->symbol binding)]
    (assoc-in binding [:init :closed-overs] (get mapping name))))



(defn lift-fns


                ;; compute the mapping from symbols to partial applications
                fns'      (map-vals fns
                                    (partial lift-fns (atom [])))]

            (-> ast
                (assoc :bindings (->> bindings'
                                      (mapv #(ast/prewalk %
                                                          (partial rewrite-locals
                                                                   fns')))
                                      (mapv #(ast/prewalk %
                                                          (partial rewrite-locals
                                                                   @locals->vars)))))

                ;; force to a let form
                (assoc :op :let))))

