-
Notifications
You must be signed in to change notification settings - Fork 15
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
Hexadecimal and binary literals #429
Comments
Related to issue #241. One of the issues here is with the sign bit. In languages with fixed-length integers, 0xFFFFFFFF means -1 because we know there are 32 bits; with a variable-length integer, that doesn't work, and it's going to throw people if we adopt the familiar syntax with unfamiliar semantics. |
I would propose to do the same what I summarized in #241 (comment): Most languages (including JavaScript, Python, Perl, or PHP) interpret |
This ticket if I'm correct is about changing how XPath parses number |
If we have functions to do the conversions, and I think we should, adding the ability to write literals in hex and binary seems unnecessary to me. The compiler can obviously evaluate |
I think it does make a difference, as it's much easier to write It's still helpful to have additional functions, as they allow you to interpret dynamic input. |
I’m getting tenacious (I beg pardon), but I believe XPath and XQuery are the only languages I have worked with so far that don’t support hexadecimal/binary literals. If it turns out that the addition is more complex than I would hope, though, I agree we should focus on the existing to-dos. |
I side with @ChristianGruen and am in favour of adding additional literals that are common to other programming languages. |
I would always interpret the hexadecimal/binary literals as unsigned/positive values -- more specifically as
If the user wants a negative value, they can use |
Closed by #433 |
Without wanting to challenge our weekly burn-down chart too much, I wonder whether it would be a big deal to support hexadecimal and binary literals in XPath? Examples:
The main question is probably if it conflicts with the existing grammar?
The text was updated successfully, but these errors were encountered: