On Sun, Nov 23, 2008 at 5:39 PM, samppi <[EMAIL PROTECTED]> wrote: > > The answer to your question at the end, by the way, is that you're not > var-quoting the x. 'defn attaches metadata to the variable object you > define, not the function object itself. (meta x) is the metadata of > the _value_ of x, which is just the function with no metadata. To get > the variable's metadata, you need to refer to the variable itself, by > using #'x, equivalent to (var x). ^#'x, or (meta (var x)), should > return {:a 1}.
Thanks for the explanation. > With my second example, I didn't mean that I was defining a new > defmethod or anything. I meant that the Clojure core's defmethod does > not accept any metadata, unlike defn. Now I see that it's possible to > attach metadata to the method's symbol—but that as far as I can tell > is unretrievable. Ah well, this might become possible in the future, > but for now I'll just put my tests in another file. :) -- Michael Wood <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---