Hello,

Maybe this is a dumb question, but I have been trying to get deftype class 
annotations to work for a few hours now, ended up reading most of the code 
in Compiler.java and short of debugging Clojure, I'm out of ideas. As I 
understand the murky interactions between deftype, metadata and Java 
annotations, the following should be true:

(deftype ^{:foo "bar"} Foo [x]) (-> (Foo. nil) class .getAnnotations 
alength) ; => 1

However, that expression returns 0 - from reading the source code, this *should 
*work, but I'm not sure if I'm missing something here. Googling the problem 
turned up a gist that Rich posted back in 2010: 
https://gist.github.com/richhickey/377213 - however, the code from his 
example actually doesn't work with Clojure 1.5, which leads me to believe 
this is a recent change. Is there a new way to attach metadata to records 
and types? Are annotations supposed to work this way?

Thanks,
Adam

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to