     (doseq [[params & body] methods]
       (let [env (assoc env
                   :params (take-while before-rest params)
-                  :restarg (second (drop-while before-rest params)))]
+                  :restarg (second (drop-while before-rest params))
+                  :arglists arglists)]
         (gen-body cw env body)))
     (gen-applier cw thistype arglists)
     (gen-handle cw thistype arglists)))

          (list 'let (list (list res (explode-invocation call)))
                res))))

(defn emit-tail-call
  [{:keys [recur-sym restarg top-label params] :as env} ^GeneratorAdapter gen [fun & args :as call]]
  (if (= fun recur-sym)
                                        ; Self call, becomes loop
    (do
      (debug "emitting self tail-call: " call)
      (when (or (and restarg (< (count args) (count params)))
                (not= (count args) (count params)))
        (throw (IllegalArgumentException.
                (str "Wrong number of args (" (count args) " for " (count params) (when restarg "+") ")"))))
                                        ; emit all new values
      (dotimes [n (count params)]
        (emit env :context/expression gen (nth args n)))
      (when restarg
        (let [extra (seq (drop (count params) args))]
          (AsmUtil/pushInt gen (count extra))
          (. gen newArray object-type)
          (dotimes [n (count extra)]
            (. gen dup)
            (AsmUtil/pushInt gen n)
            (emit env :context/expression gen (nth extra n))
            (. gen arrayStore object-type))))
                                        ; store them in reverse order from stack
      (dotimes [n (count params)]
        (. gen storeArg (- (count params) n (if restarg 0 1))))
      (. gen goTo top-label))
                                        ; Calls another fn, return continuation thunk
    (do

  [env context ^GeneratorAdapter gen [_ name val :as form]]
  (when (> (count form) 3)
    (throw (IllegalArgumentException. "define only takes one value")))
  (binding [*lambda-name* name]
    (set-global! name (eval* val)))
  (emit env context gen name))

(defmethod emit-seq 'define-macro
  [env context ^GeneratorAdapter gen [_ name val :as form]]
  (when (> (count form) 3)
    (throw (IllegalArgumentException. "define-macro only takes one value")))
  (binding [*lambda-name* name]
    (set-macro! name (eval* val)))
  (emit env context gen name))

(defmethod emit-seq 'if
