Skip to content

Commit

Permalink
propagate metadata to classnames in definterface/type/record
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Apr 23, 2010
1 parent c2a6a07 commit 5916e9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/clj/clojure/core_deftype.clj
Expand Up @@ -16,7 +16,7 @@
(let [tag (fn [x] (or (:tag (meta x)) Object))
psig (fn [[name [& args]]]
(vector name (vec (map tag args)) (tag name)))
cname (symbol (str *ns* "." name))]
cname (with-meta (symbol (str *ns* "." name)) (meta name))]
`(do (gen-interface :name ~cname :methods ~(vec (map psig sigs)))
(ns-unmap (find-ns '~(ns-name *ns*)) '~name)
(import ~cname))))
Expand Down Expand Up @@ -111,7 +111,7 @@
"Do not use this directly - use defrecord"
[tagname name fields interfaces methods]
(let [tag (keyword (str *ns*) (str tagname))
classname (symbol (str *ns* "." name))
classname (with-meta (symbol (str *ns* "." name)) (meta name))
interfaces (vec interfaces)
interface-set (set (map resolve interfaces))
methodname-set (set (map first methods))
Expand Down Expand Up @@ -275,7 +275,7 @@
(defn- emit-deftype*
"Do not use this directly - use deftype"
[tagname name fields interfaces methods]
(let [classname (symbol (str *ns* "." name))]
(let [classname (with-meta (symbol (str *ns* "." name)) (meta name))]
`(deftype* ~tagname ~classname ~fields
:implements ~interfaces
~@methods)))
Expand Down

0 comments on commit 5916e9e

Please sign in to comment.