Is it possible to add meta-data to Strings?

(with-meta "Hello" {:key 123})

java.lang.String cannot be cast to clojure.lang.IObj
  [Thrown class java.lang.ClassCastException]

One solution that I found by Googling around is to extend the Java
class that I want to add meta data (String in this case) and have the
new class implement IObj. However, that solution requires me to
program in Java and seems like an overkill for the String class.

Is there a better & easier way to add meta-data to strings?

Sincerely,
Jung Ko

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to