updated to ClojureScript master on the non-React Native bits of a work project - appears to work fine
still looking into React Native issues so we can provide some guidance beyond downgrading
In ClojureScript I can do this: (-> (var a) meta :doc)
(thanks to the work described here: https://swannodette.github.io/2014/12/17/whats-in-a-var/)
Right now though, I can’t do this: (-> (var a) meta :ns meta :doc)
because we have var metadata output by the compiler but not namespace metadata.
So we have var docs but not namespace docs. Would it be possible/desirable to allow this?
no. CLJS does not have vars or namespaces at runtime (in a CLJ sense). var
is implemented as a macro and hardly useful if you want to do var based things like you would in CLJ. you can implement a macro and query all the things you want directly from the analyzer data. besides that you cannot dynamically lookup ns metadata in CLJS at runtime since it does not exist.
if you use self-hosted you can directly dig into the analyzer data at runtime too but normal CLJS doesn't have this data available at runtime
when joelittlejohn and I were talking in another channel, I was struck by the fact that it was easy enough to get var info with static invocations but the same ns info wasn't available from any macro in cljs.core
I agree that it's pretty niche.
@thheller Yeah, I have implemented my own macro for this. From the blog post though: > ClojureScript now delivers fantastic facilities for user programs to reflect on static information known to the compiler to enable powerful forms of metaprogramming. All this without sacrificing a compilation model that enables reasonably compact and efficient JavaScript. Seems like this idea can easily be extended to namespace metadata.