2010/1/20 Jacek Generowicz <jacek.generow...@googlemail.com>:
> What is the purpose of the attribute map?

The attribute map is added to the meta-data of the created. Meta-data
contains info which can be used at runtime or to create documentation
but is not part of the object itself and does not affect equality.
Specifically for defmulti you might use it like this:

(defmulti foo "This is foo" {:author "me", :arglists '([bar])} type)

Notably defmulti does not automatically create an arglists like defn
and defmacro do. So this is a good example where you might want to use
an attribute map to specify that. Speaking of which, it would seem
that a good default arglists would be to copy the dispatch functions
arglists, which would at least provide the correct arity... anyone
agree/disagree?

You can view meta data like so: (meta (var foo))
Note that the file/line is stored in meta-data for debugging,



> where could I have found an explanation in the documentation ?

Hmmm not sure for this one.


Regards,
Tim.
-- 
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