Fork me on GitHub
Sam Ritchie22:01:29

Execution error (ExceptionInfo) at sci.impl.utils/throw-error-with-location (utils.cljc:22).
Could not resolve symbol: java.lang.Math/abs

Sam Ritchie22:01:49

Question… is there some other way to call Math/abs inside an sci macro?


$ bb -e '(java.lang.Math/abs -1)'
yes, but you have to explicitly add it to :classes


{:classes {'java.lang.Math java.lang.Math}}

Sam Ritchie22:01:36

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

Sam Ritchie22:01:14

yup, I had ported the “fork” macro from macrovich to work in sci so I could explicitly provide js/Math for this case

Sam Ritchie22:01:56

thank you!

👍 1