Basically, any time you're part way through implementing some feature and you realize you need to carry along extra data with something, but you don't want to change the data you return, use metadata.
For example, I was working with creating a rule system that needed to convert certain Clojure hash maps to java beans. However, rather than include a :class attribute in the hash map (which would mess with the semantics of the system I made), I just included the class in metadata. On Monday, 12 November 2012 23:55:31 UTC-5, Takahiro Hozumi wrote: > > > Metadata is a really useful feature, and it's been helping me a lot. > Could you show me concrete example? > I still don't understand the value of metadata and rarely use it > except type hint. > I saw active using metadata on some project(e.g. postal[1]), but I > think regular hashmap instead of metadata is also good enough for the > purpose. > > [1] https://github.com/drewr/postal > > Cheers, > -Takahiro > > On Nov 13, 6:01 am, JvJ <kfjwhee...@gmail.com> wrote: > > Metadata is a really useful feature, and it's been helping me a lot. It > > seems like a flash of genius on the part of Mr. Hickey. I'm wondering > if > > similar concepts exist in other programming languages that inspired it, > or > > if it's unique to Clojure. Just a matter of curiosity, really. > -- 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