Hi,

I want to attach reader metadata to a var, in a similar fashion to the :tag
key.

(^{:a :b} float? 1)

My use case is manual instantiation of type arguments to polymorphic
functions. I need the compiler
to add a metadata map to the results of analysis. In the absence of reader
macros, this seems to be
the only strategy.

(ast macro from `analyze <https://github.com/frenchy64/analyze>`)

Current behaviour:

;; Without reader metadata ...
typed.core=> (ast float?)
{:op :var, :env {:locals {}, :ns {:name typed.core}}, :var
#'clojure.core/float?, *:tag nil*}

;; :tag is handled explicitly by the Compiler
typed.core=> (ast *^{:tag Class}* float?)
{:op :var, :env {:locals {}, :ns {:name typed.core}}, :var
#'clojure.core/float?, *:tag Class*}

;; .. but other metadata is thrown away.
typed.core=> (ast *^{:a :b}* float?)
{:op :var, :env {:locals {}, :ns {:name typed.core}}, :var
#'clojure.core/float?, *:tag nil*}

Ideal behaviour :

;; Could return a map via a :meta key
typed.core=> (ast *^{:a :b}* float?)
{:op :var, :env {:locals {}, :ns {:name typed.core}}, :var
#'clojure.core/float?, :tag nil, *:meta {:a :b}*}

Any thoughts, suggestions, advice welcome.

Thanks,
Ambrose

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