 
   (doseq [a args]
     (emit env :context/expression gen a))
-  ;; (. gen invokeDynamic "invoke" invoke-descriptor invoke-handle (into-array Object [cname]))
   (. gen invokeVirtual (asmtype MethodHandle)
      (Method. "invoke" object-type (into-array Type (cons ilambda-type (repeat (count args) object-type)))))
 

    (catch ClassNotFoundException e)))

(def object-array-class (class (object-array 0)))

;; (dotimes [n 21]
;;   (eval `(gen-interface :name ~(symbol (str "wombat.ILambda" n))
;;                         :extends [~'wombat.ILambda]
;;                         :methods [[~'invoke [~@(repeat n Object)] ~'Object]]))
;;   (eval `(import ~(symbol (str "wombat.ILambda" n)))))

;; (eval
;;  `(gen-interface :name ~'wombat.ILambda21
;;                  :extends [~'wombat.ILambda]
;;                  :methods [[~'invoke [~@(repeat 20 Object) ~(.getName object-array-class)] ~'Object]]))

(def ^:dynamic *print-debug* true)
(defn debug [& vals]

  (debug "emitting invoke:" call)
  (debug "context:" context)

  (emit env :context/expression gen fun)

  (. gen dup)
  (. gen checkCast ilambda-type)
  (AsmUtil/pushInt gen (count args))
