(defn parse-reify*
[[_ interfaces & methods :as form] env]
(let [interfaces (conj (disj (set (mapv maybe-class interfaces)) Object)
IObj)
name (gensym "reify__")
class-name (symbol (str (namespace-munge *ns*) "$" name))
menv (assoc env :this class-name)
methods (mapv #(assoc (analyze-method-impls % menv) :interfaces interfaces)
methods)]
(-deftype name class-name [] interfaces)
(wrapping-meta
{:op :reify
:env env
:form form
:class-name class-name
:methods methods
:interfaces interfaces
:children [:methods]})))