-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Array Lookups: partial removal of out-of-bounds checks #1715
Comments
Indeed, Saxon on the development branch is currently not doing bound checks for the array lookup operator. I would be quite happy to drop array bound checking entirely, bringing arrays into line with sequences. |
Related: #1363 |
Even better. I would be glad to see all of them go. |
We need to be aware that there is a backwards-incompatibility. Normally we treat it as OK to abolish an error condition, but this error is one where people might conceivably be relying on try/catch. Despite this, I'm inclined to go ahead. (A processor could issue a warning if it sees |
Completely true. I wanted to add a note to my last comment, indicating that I didn’t find a single occurrence of @line-o I stumbled across eXist-db/exist#3275. What do you think about removing out-of-bounds checks for arrays? |
It could be backward compatible with a global setting, like:
or
|
That's certainly an option to consider. I can't say I like proliferation of context-dependent behaviour, but it's viable. |
Various QT4 tests imply that the out-of-bounds check for arrays have been removed. An example:
I believe this is not reflected in the spec yet, or at least it includes examples that need to be updated:
I guess that #832 would have been the PR with the relevant changes (we have already observed in another issue that some changes of this PR need to survive; see #1283 (comment)).
That leads me to the original reason for creating this issue:
$array?0
and$array(0)
should behave identically.FOAY0001
error would (and should) still be raised by the array functions, includingarray:get
,array:put
,array:remove
, orarray:insert-before
.The text was updated successfully, but these errors were encountered: