Skip to content
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

Editorial: Define both integer index and array index using inclusive intervals #2613

Merged
merged 7 commits into from
May 25, 2023

Conversation

gibson042
Copy link
Contributor

@gibson042 gibson042 commented Jan 8, 2022

I think #2502 stems in part from inconsistency in the definition of integer index with an inclusive upper bound of 2**53 - 1 vs. array index with an exclusive upper bound of 2**32 - 1, obscuring the fact that only the latter excludes the integer immediately preceding the relevant power of two (because array length rather than maximum index is constrained to uint32). This is an attempt to clear that up by defining both terms as analogous inclusive intervals (with clearly different upper bounds), along with some miscellaneous related improvements in separate commits.

Alternatively, it might make sense to use analogous half-open intervals, e.g. +0𝔽i < 𝔽(253) vs. +0𝔽a < 𝔽(232 - 1).

@gibson042 gibson042 force-pushed the 2022-01-array-index-upper-bound-clusivity branch from 679a26d to 7833ae4 Compare February 12, 2023 17:59
@gibson042 gibson042 changed the title Editorial: Define both integer index and array index using closed intervals Editorial: Define both integer index and array index using inclusive intervals Feb 12, 2023
spec.html Outdated Show resolved Hide resolved
Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % question

spec.html Outdated Show resolved Hide resolved
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label May 25, 2023
Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still lgtm, thanks!

@ljharb ljharb force-pushed the 2022-01-array-index-upper-bound-clusivity branch from 12bc338 to 86614b7 Compare May 25, 2023 16:54
@ljharb ljharb merged commit 86614b7 into tc39:main May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants