Hi,

On Feb 17, 11:44 am, metaperl <scheme...@gmail.com> wrote:

> I was able to successfully define and use the mymax function, but when
> I try to examine the metadata, I get the error above. Source code and
> REPL transcript follow:
>
> ========================================================
>
> user=> (com.new-ns/mymax 4 2 9 1)
> 9
> user=> #^'com.new-ns/mymax
> #<IllegalArgumentException java.lang.IllegalArgumentException:
> Metadata must be Symbol,Keyword,String or Map>

#^ attaches metadata to the following thing read. So "#^{:a :b} x"
will set the map {:a :b} as metadata for the symbol x. "#^String x" is
shorthand for "#^{:tag String} x" which gives a tip to the compiler
that x is a String.

What you need is "meta": (meta (quote #^{:a :b} x)) => {:a :b}

Sincerely
Meikel

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