clojurescript

souenzzo 2024-10-15T00:14:04.076789Z

Why am I able to use (Math/pow 2 3) in cljs (as js/Math exists) But I can't use (Reflect/get ...)? js/Reflect also exists!

cljs.user=> (Reflect/get #js{:a 42} "a")
WARNING: No such namespace: Reflect, could not locate Reflect.cljs, Reflect.cljc, or JavaScript source providing "Reflect" at line 1 
WARNING: Use of undeclared Var Reflect/get at line 1 
42 ;; actually works after many WARNINGS
Note: I know that I can use (js/Reflect.get ...). My question is "why some globals act like java classes and others do not"

daveliepmann 2024-10-15T07:37:47.363119Z

Math and js are listed as special namespaces in the cljs API https://cljs.github.io/api/syntax/Math-namespace

👍 1