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
Having this feature will open up a lot of new possibilities for this project.
For example, the evaluation of pure functions with constant arguments. This would require some pretty clever evaluation, because the program needs to understand if a function is pure.
More reasonably, the first rules exploiting this feature could be to evaluate binary expressions using constant expressions (like a literal string or a number).
Examples:
Original code
Processed code
10 * 50 + 2
502
true or false
true
87 == "hello"
false
This also opens the possibility to optimize if branches, by evaluating conditions at compile time and stripping unused branches.
Activity
jeparlefrancais commentedon Mar 19, 2020
Now that the Evaluator struct is partly implemented, this issue can be used to keep track of what darklua is currently able to evaluate.
Values:
==,~=<,<=,>,>=+,-,*,/,%,^..-#(for strings)#(for tables)