         ;;    all the locals of the body expression.
 
         (let [bindings     (:bindings ast)
-              locals->vars (atom {})]
+              locals->vars (atom {})
+              env          (:env ast)]
 
           ;; create the forward defs
           (doseq [b bindings]

            [oxcart.pattern :as pattern]
            [clojure.tools.analyzer.ast :as ast]
            [clojure.tools.analyzer.passes.jvm.emit-form :refer [emit-form]]
            [clojure.tools.analyzer.jvm :refer [update-ns-map!]]
            [clojure.tools.analyzer.passes.collect
             :refer [collect-closed-overs]]
            [clojure.set :refer [union]]))

                          pattern/fn->name
                          symbol)
                  {:keys [statements ret]} (util/ast `(do (def ~sym)
                                                          ~sym)
                                                     env)
                  def-ast (first statements)]

              ;; save the def ast
