This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-12
Channels
- # announcements (2)
- # babashka (26)
- # beginners (48)
- # calva (32)
- # cider (23)
- # clj-kondo (61)
- # cljfx (3)
- # clojure (93)
- # clojure-australia (2)
- # clojure-europe (23)
- # clojure-losangeles (1)
- # clojure-nl (5)
- # clojure-uk (4)
- # clojurescript (46)
- # cloverage (9)
- # code-reviews (1)
- # copenhagen-clojurians (1)
- # cursive (39)
- # data-science (6)
- # datahike (8)
- # deps-new (8)
- # depstar (2)
- # etaoin (1)
- # fulcro (2)
- # funcool (2)
- # graalvm (5)
- # jackdaw (3)
- # java (17)
- # jobs-discuss (43)
- # kaocha (2)
- # leiningen (25)
- # malli (8)
- # minecraft (1)
- # missionary (8)
- # observability (6)
- # off-topic (37)
- # other-languages (12)
- # practicalli (1)
- # reagent (4)
- # releases (78)
- # remote-jobs (1)
- # sci (9)
- # shadow-cljs (13)
- # spacemacs (6)
- # sql (1)
- # tools-deps (30)
- # xtdb (3)
Execution error (ExceptionInfo) at sci.impl.utils/throw-error-with-location (utils.cljc:22).
Could not resolve symbol: java.lang.Math/abs
Question… is there some other way to call Math/abs
inside an sci macro?
$ bb -e '(java.lang.Math/abs -1)'
1
yes, but you have to explicitly add it to :classes
nice and that will work with sci in a js environment?
in JS, if you want to give access to anything, you do: {:classes {'js goog/global :allow :all}}
but you have to write (js/Math.abs ...)
in this case. If you want to allow (Math/abs ...)
then you also need to insert 'Math
explicitly
yup, I had ported the “fork” macro from macrovich to work in sci so I could explicitly provide js/Math for this case