The Eastwood [1] Clojure lint tool has a few warnings in it that warn about
unused metadata in your code.

The :unused-meta-on-macro warns about metadata on macro invocations, which
is usually ignored by Clojure [2].

The :wrong-tag warns about unused type tag metadata on Vars, and
non-fully-qualified Java class names on arg vectors [3].

Andy

[1] https://github.com/jonase/eastwood
[2] https://github.com/jonase/eastwood#unused-meta-on-macro
[3] https://github.com/jonase/eastwood#wrong-tag

On Tue, May 5, 2015 at 5:51 PM, Mike Rodriguez <mjr4...@gmail.com> wrote:

>
> What you wanted here was
>
>  (meta '^:abc some-symbol)
>
> It's a little weird but the reader attaches the metadata to the symbol.
> Then the quote just evaluates directly to the same symbol, so the metadata
> is preserved.
>
> I agree that metadata can be confusing though. Especially around where AND
> HOW you put the metadata for a functions return value(s).
>
> See [1] for more on that confusing track...
>
> Also there are plenty of subtle "gotchas" to macros etc that do not
> preserve metadata. 'clojure.core/or' is a good example of that.
>
> A search for "Clojure preserve metadata" will likely turn up a good list
> of Jiras out there to fix areas that do not preserve metadata as expected.
>
> Looks like there are some tips at [2].
>
> [1] http://dev.clojure.org/jira/browse/CLJ-1232
> [2]
> http://stackoverflow.com/questions/4673011/what-functions-in-clojure-core-preserve-meta
>
> --
> 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.
>

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