In addition to James comment: IMO clojure.org/metadata should be clearer 
about this. It's mentioned more clearly on the reader page:
http://clojure.org/reader#The%20Reader--Macro%20characters
"The metadata reader macro first reads the metadata and attaches it to the 
next form read (see with-meta 
<http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/with-meta> 
to 
attach meta to an object):"

Stress on *next form read*.

On Tuesday, May 5, 2015 at 2:31:40 PM UTC-4, Andrey Antukh wrote:
>
> Hi!
>
> I have some trouble with clojure metadata / reader and I do not know if 
> I'm doing something wrong.
>
> I have this code:
>
> (defn some-func [])
>
> (def func ^:abc some-func)
>
> (assert (= (meta func) {:abc true}))
>
> (def data [[:bar (with-meta some-func {:abc true})]
>            [:baz ^:abc some-func]])
>
> (assert (= (meta (get-in data [0 1])) {:abc true}))
> (assert (= (meta (get-in data [1 1])) {:abc true}))
>
> It fails in the first assert and in the last (if I comment the first one 
> obviously). I do not understand why that form of metadata does not works
> as I expect (http://clojure.org/metadata)
>
> Thank you very much.
>
> Regards.
> Andrey
>
> -- 
> Andrey Antukh - Андрей Антух - <andrei....@kaleidos.net <javascript:>> / <
> ni...@niwi.be <javascript:>>
> http://www.niwi.be <http://www.niwi.be/page/about/>
> https://github.com/niwibe
>  

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to