-
-
Couldn't load subscription status.
- Fork 295
Space Lua: Align arithmetic model with standard Lua #1611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space Lua: Align arithmetic model with standard Lua #1611
Conversation
Signed-off-by: Matouš Jan Fialka <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is looking simpler than before. As I understand it you do end up using a boxed value (new Number) in the end and do all the conversions around that. Is Number somehow preserving whether a value was an integer or a float? I don't really understand this part.
|
We only add distinction for zero and only when needed in order to align with Lua. Number itself does not preserve int vs float but we do, via a Symbol tag, on boxed +0 and by recomputing "integerness" for non-zero values. |
Signed-off-by: Matouš Jan Fialka <[email protected]>
Signed-off-by: Matouš Jan Fialka <[email protected]>
Signed-off-by: Matouš Jan Fialka <[email protected]>
Signed-off-by: Matouš Jan Fialka <[email protected]>
Signed-off-by: Matouš Jan Fialka <[email protected]>
|
The code seems to be working as expected (as I hope). There is some code left that may be deduplicated into helper wrappers but I am uncertain about this step for I do not know what the impact of extra function calls to these wrappers would be in terms of performance. It won't be hard to make this step later... It does not break anything for me and also passes all checks and tests. I also do not see any performance impact personally. Both does not mean there is not some issue left, or some performance regression will occure. This branch also adds missing
|
Signed-off-by: Matouš Jan Fialka <[email protected]>
- add new basic tests - add helper for negative tests - add more negative tests - fix few typos Signed-off-by: Matouš Jan Fialka <[email protected]>
Signed-off-by: Matouš Jan Fialka <[email protected]>
|
Alright, this works for me. I mostly understand what's happening here. Thanks for the effort! |
This patchset aligns Space Lua arithmetic model with standard Lua. It also extends arithmetic test suite for Space Lua.