It would be better, I think, if metadata was attachable via a protocol rather than than a wrapper: then you could just extend the protocol to any arbitrary Java class. Wrappers are a pain to make work because of wrapping / unwrapping and protocols also have the advantage of being very efficient.
I've wanted a similar feature with respect to "seq" as well (a protocol for things that can be treated as sequences) On Saturday, 31 August 2013 03:16:26 UTC+8, JvJ wrote: > > I've noticed that, when doing a lot of Java interop, it's impossible to > attach metadata to most Java objects, since they don't implement the IMeta > interface. A workaround for this would be to do something like put every > Java object in a single-element list and attach metadata to the list, but > this is annoying. Would it be possible (or even useful) to create some > kind of generic IMeta structure that can wrap other Java objects and have > them act like normal, except for the added metadata (or even other > Clojure-esque features)? > -- -- 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.