How to access compile time cljs var metadata from a clj macro?
<p>I'd like to construct a ClojureScript macro (executed/compiled via Clojure) that informs it's construction of a return form based on the static, compile-time metadata of a ClojureScript var argument.</p>

<p>I understand it is possible to access compile-time, static var metadata from ClojureScript code (using <code>(meta (var varsym))</code>; see <a href="http://swannodette.github.io/2014/12/17/whats-in-a-var/">this post</a>). But is this data accessible to the compilation process in such a way that we could access it from a macro?</p>

<p>Here's a rough sketch of what I'd like to do (and the question is really how you'd write <code>get-meta-for-varsym</code> below):</p>

<pre><code>;; executed/compiled in clj, targeting cljs
(defmacro themacro
  [varsym &amp; args]
  (let [var-meta (get-meta-for-varsym varsym)
        return-form (compile-return-form-from-metadata var-meta args)]
    return-form))
</code></pre>