-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Override operators with the scope just like functions #2631
Copy link
Copy link
Open
Labels
Description
f(x,y) = (y==0) ? undefined : x%y; evaluate('mod(22,0)', {mod: f})\n evaluate('22 % 0', {mod: f})yields
[undefined, 22].
That is an interesting case. What happens right now is that functions and constants can be provided by the scope passed to math.evaluate, but this will not have effect on operators. I.e. passing mod or add or so to scope will not replace the operators % and + etc. It makes sense that they would.
Originally posted by @josdejong in #2617 (comment)
The purposeof this issue is to discuss whether overriding serve as a marker that a PR to do this is needed.)mod, add, etc. in the scope should affect the outcome of infix operators like %, +, etc. (And if the conclusion is so,
Reactions are currently unavailable