-
Notifications
You must be signed in to change notification settings - Fork 57
feat: toNumeric and checkNumeric #173
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
Conversation
c01a0f3
to
994d49e
Compare
(the CI failures on nightly for windows appear unrelated and touch on stuff that is actively being worked on in Zig master) |
These functions rely (lightly) on Zig's comptime to minimize some of the annoying overhead of writing `@intCast` and `@floatCast` all the time by making those builtins part of the function definition. However, since those builtins assert in builds with runtime safety enabled, these functions will crash the program if called with bad Lua input. More discussion is warranted about the tradeoffs of going this route before merging. Resolves #172.
994d49e
to
74e7cf7
Compare
@nurpax I'd appreciate your eyes :) |
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.
The semantics for the change are exactly as discussed. I did add some code comments though, since you asked. :) Nothing serious though.
1fc7ff6
to
1ace820
Compare
1ace820
to
e5d99be
Compare
These functions rely (lightly) on Zig's comptime to minimize some of the annoying overhead of writing
@intCast
and@floatCast
all the time by making those builtins part of the function definition. However, since those builtins assert in builds with runtime safety enabled, these functions will crash the program if called with bad Lua input. More discussion is warranted about the tradeoffs of going this route before merging.Resolves #172.