    :author "Reid McKenzie"}
   (:refer-clojure :exclude [eval macroexpand-1 macroexpand load compile])
   (:require [clojure.tools.analyzer.jvm :as ana.jvm]
-            [clojure.tools.analyzer 
-             :refer [macroexpand-1 
+            [clojure.tools.analyzer
+             :refer [macroexpand-1
                      macroexpand]
              :as ana]
             [clojure.tools.emitter.jvm.emit :as e]


           (doseq [expr statements]
             (eval expr options))
           
           (eval ret options))

         ;; bare expression handling
         ;;-----------------------------
         ;; FIXME:
         ;;   Is there some way that I can merge this so that only one
         ;;   ana.jvm/analyze invocation is required? I think the
         ;;   answer is no, but it'd be nice.
         (let [ast   (binding [ana/macroexpand-1 ana.jvm/macroexpand-1
                               ana/create-var    ana.jvm/create-var
                               ana/parse         ana.jvm/parse
                               ana/var?          var?]
                       (ana.jvm/analyze mform 
                                        (or env (ana.jvm/empty-env))))
               r     (-> `(^:once fn* [] ~mform)
                         (ana.jvm/analyze (or env (ana.jvm/empty-env)))
                         (e/emit {:debug?       debug?
                                  :class-loader (or classloader
                                                    (clojure.lang.RT/makeClassLoader))}))
               class (-> r meta :class)]
           
           ;; the accumulator for the whole read program
           (when (and forms-ast
                      (atom? forms-ast))
             (swap! forms-ast conj ast))
           
           ;; the accumulator for defs to structure
           (when (and defs-ast
                      (atom? defs-ast)
                      (patern/def? ast))
             (swap! defs-ast assoc 
                    (patern/def->symbol ast)
                    ast))

           ;; and run the code for side-effects
           (.invoke ^IFn (.newInstance ^Class class)))))))


(defn load

  config-map:
   `:passes` is a sequence of functions constituting an optimization
    configuration. These functions must be
    (λ form-seq → def-map → settings → form-seq)
    and pure. It is expected but not enforced that passes may not
    emit nodes which an emitter does not support. If passes is empty
    no program transformations will be done and the emitter will be
    invoked directly.

    `:emitter` is a single function which is λ form-seq → nil which
    is expected to emit the appropriate classfiles as side effects.

    `:settings` may be a map containing `:passes` and `:emitter`,
    these being option maps which will be applied respectively at the
