cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dnolen 2021-03-10T14:48:34.090800Z

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

dnolen 2021-03-10T14:48:51.091500Z

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

joelittlejohn 2021-03-10T17:59:02.094400Z

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?

thheller 2021-03-10T18:05:25.097900Z

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.

thheller 2021-03-10T18:06:42.098700Z

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

lilactown 2021-03-10T18:15:45.100300Z

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

lilactown 2021-03-10T18:16:35.101100Z

I agree that it's pretty niche.

joelittlejohn 2021-03-10T19:12:24.105100Z

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