           (emit-symbol env :context/expression gen (nth closed-overs n)))
         (. gen invokeConstructor (Type/getObjectType slashname)
            (Method. "<init>" Type/VOID_TYPE (into-array Type (repeat (count closed-overs) object-type))))))))
+
+(defmethod emit-seq 'case-lambda
+  [env context ^GeneratorAdapter gen case-lambda]
+  (emit-lambda env context gen case-lambda))
+
+(defmethod emit-seq 'lambda
+  [env context ^GeneratorAdapter gen [_ params & body :as lambda]]
+  (emit-lambda env context gen lambda))
 
 ;; (defmethod emit-seq 'define-class*
 ;;   [env context gen [_ fields :as defcls]])

    (gen-ctor cw fqname fv)
    (binding [*lambda-name* (if *top-level* *lambda-name* nil)]
      (gen-methods cw env methods))
    (. cw visitEnd)))

(defmethod compile 'lambda
  [[_ params & body :as lambda]]
  (when-not (get @*compiled-lambdas* lambda)
    (validate-params! params)
    (debug "Compiling:" lambda)
    (let [
          before-rest (complement #{rest-token})
          restarg (second (drop-while before-rest params))
]
      (binding [*lambda-name* (if *top-level* *lambda-name* nil)]
        (. cw visit Opcodes/V1_7 Opcodes/ACC_PUBLIC fqname nil "java/lang/Object" ifaces)
        (gen-closure-fields cw fv)
        (gen-ctor cw fqname fv)
        (gen-body cw env body)
        (gen-applier cw env)
        (gen-handle cw env)
        (. cw visitEnd))
      (swap! *compiled-lambdas* conj lambda)
      [dotname (.toByteArray cw) fv])))

(defmethod compile 'case-lambda
  [[_ & methods :as case-lambda]]
  (debug "Compiling:" case-lambda)
  (let [fv (vec (free-vars case-lambda))
        cw (ClassWriter. ClassWriter/COMPUTE_FRAMES)
        lname (str (dotmunge (str (or *lambda-name* 'lambda))) "_" (next-id))
        fqname (str "wombat/" lname)
        dotname (.replace fqname "/" ".")
        ifaces (into-array String ["wombat/ILambda"])]))

(defn emit
  [env context gen form]

        
        (. gen mark switch-label)
        ;; arity arg is on stack
        (. gen tableSwitch (int-array fixed) switch-generator)
        (. gen mark end-switch-label))
    
      (. gen returnValue)
