You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it could be nice to map the standard mathematical functions like sin, cos, tan, sqrt, ... to their JS counterpart like Math.sin, Math.cos, Math.tan, Math.sqrt; the list of js math functions seems to suggest this is fairly straightforward (names are mostly identical).
Another nice step would be to interpolate symbols like π or ℯ.
PS: I'm happy to try to open a PR but I'd need some guidance as to what's the likely good way to go about this
The text was updated successfully, but these errors were encountered:
I'm opposed to this change, though I'm willing to consider it.
(IMO) I think it should be very clear that the code you are writing is not Julia - it is JS, and I'm opposed to anything that lulls the user into thinking that they're writing Julia. JS is very different from Julia and sometimes has very different semantics.
If someone wants to simulate this themself, they can just do
const setup_function @jsfunction()
for s in ["sin", "cos", "tan", "sqrt"]
# .bind might not be necessary for math functions, but better safe than sorry
window[s] = Math[s].bind(Math)
endend
In the v1 of JSExpr (which is unreleased because I've yet to go update WebIO to be compatible), there's functionality that makes it really easy to extend existing JSExpr functionality (the only downside is that it's global, so might adversely impact unrelated modules if they happen to use identifiers named sin, cos, etc.)
it could be nice to map the standard mathematical functions like
sin, cos, tan, sqrt, ...
to their JS counterpart likeMath.sin, Math.cos, Math.tan, Math.sqrt
; the list of js math functions seems to suggest this is fairly straightforward (names are mostly identical).Another nice step would be to interpolate symbols like
π
orℯ
.PS: I'm happy to try to open a PR but I'd need some guidance as to what's the likely good way to go about this
The text was updated successfully, but these errors were encountered: