Skip to content

Commit

Permalink
added IObj and metadata propagation support for reify, so #^{:my :met…
Browse files Browse the repository at this point in the history
…a} (reify ...) works
  • Loading branch information
richhickey committed Mar 19, 2010
1 parent 109b015 commit 67864eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/clj/clojure/core_deftype.clj
Expand Up @@ -100,7 +100,7 @@

[& opts+specs]
(let [[interfaces methods] (parse-opts+specs opts+specs)]
`(reify* ~interfaces ~@methods)))
(with-meta `(reify* ~interfaces ~@methods) (meta &form))))

(defn hash-combine [x y]
(clojure.lang.Util/hashCombine x (clojure.lang.Util/hash y)))
Expand Down
9 changes: 7 additions & 2 deletions src/jvm/clojure/lang/Compiler.java
Expand Up @@ -6010,13 +6010,18 @@ public Expr parse(C context, Object frm) throws Exception{

ISeq rform = RT.next(form);

IPersistentVector interfaces = (IPersistentVector) RT.first(rform);
IPersistentVector interfaces = ((IPersistentVector) RT.first(rform)).cons(Symbol.intern("clojure.lang.IObj"));


rform = RT.next(rform);


return build(interfaces, null, null, classname, classname, null, rform);
Expr ret = build(interfaces, null, null, classname, classname, null, rform);
if(frm instanceof IObj && ((IObj) frm).meta() != null)
return new MetaExpr(ret, (MapExpr) MapExpr
.parse(context == C.EVAL ? context : C.EXPRESSION, ((IObj) frm).meta()));
else
return ret;
}
}

Expand Down

0 comments on commit 67864eb

Please sign in to comment.