   [name & body]
   `(let [~name (~'js* "this")]
      ~@body))
+
+(defn to-property [sym]
+  (symbol (core/str "-" sym)))
 
 (defmacro extend-type [tsym & impls]
   (let [resolve #(let [ret (:name (cljs.compiler/resolve-var (dissoc &env :locals) %))]

                                                         meths (map adapt-params meths)
                                                         tsym (gensym "tsym")
                                                         argsym (gensym "args")]
                                                     [`(set! ~(symbol (core/str prototype-prefix 'call)) ~(with-meta `(fn ~@meths) (meta form)))
                                                      `(set! ~(symbol (core/str prototype-prefix 'apply))
                                                             ~(with-meta
                                                                `(fn ~[tsym argsym]
                                                                   (.apply (.-call ~tsym) ~tsym
                                                                           (.concat (array ~tsym) (aclone ~argsym))))
                                                                (meta form)))])
                                                   (let [pf (core/str prototype-prefix pprefix f)]
                                                     (if (vector? (first meths))
                                                       [`(set! ~(symbol (core/str pf "$arity$" (count (first meths)))) ~(with-meta `(fn ~@meths) (meta form)))]
                                                       (map (fn [[sig & body :as meth]]
                                                              `(set! ~(symbol (core/str pf "$arity$" (count sig)))
                                                                     ~(with-meta `(fn ~meth) (meta form))))
                                                            meths)))))
                                               sigs)))))]

                                        sigs))))]
        `(do ~@(mapcat assign-impls impl-map)))
      (let [t (resolve tsym)
            prototype-prefix (fn [sym]
                               `(.. ~tsym -prototype ~(to-property sym)))
            assign-impls (fn [[p sigs]]
                           (warn-if-not-protocol p)
                           (let [psym (resolve p)
