Fork me on GitHub
#cljs-dev
<
2021-03-10
>
dnolen14:03:34

updated to ClojureScript master on the non-React Native bits of a work project - appears to work fine

dnolen14:03:51

still looking into React Native issues so we can provide some guidance beyond downgrading

Joe Littlejohn17:03:02

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?

thheller18:03:25

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.

thheller18:03:42

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

lilactown18:03:45

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

lilactown18:03:35

I agree that it's pretty niche.

Joe Littlejohn19:03:24

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