Fork me on GitHub
#clojurescript
<
2020-06-06
>
awb9904:06:54

Is there a clojurescript equivalent to the Clojure Math namespace?

Oliver George05:06:25

Someone else will know this better but the JavaScript math namespace will have some things. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math

dpsutton15:06:05

is there a way to easily find implementations of protocols from the repl? not solving a real issue just for spelunking and learning. I'm reading the sources of defprotocol and extend-type. It seems like the implementations are in [:cljs.analyzer/namespaces (:ns var) :defs (symbol (name p)) :impls] but wondering if this is exposed in some way?

dpsutton15:06:36

ns-publics is almost there. i can get the metadata on the protocol but it discards the cljs.analyzer/namespaces info unfortunately

lilactown15:06:34

they're not reified at runtime in a global map, if that's what you're asking

lilactown15:06:16

in general they're just properties on the prototype of the "type"

dpsutton15:06:00

reading the source of extend-type they are in the analyzer map under impls. Just wondering if i could get to that easily

lilactown15:06:23

not at runtime, but you could maybe write a macro that grabbed that stuff out of the analyzer and emitted it

lilactown15:06:05

I don't know how things get added / removed to the analyzer map. YMMV

tio23:06:15

Hey guys, I’m trying to configure my ClojureScript repl for the browser. Basically I can’t get my repl going (there’s no error or anything) … I put more details in #leiningen if anyone here has experience with this. Thank you!