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

Add code unit prefix, less than, and general sorting #248

Merged
merged 3 commits into from
May 10, 2019
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented May 3, 2019

Closes #55.

Will be needed for Import Maps.


Preview | Diff

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

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

I found a couple nits. I'm also unsure if we should close #55 as it identified a number of non-code-unit cases that still need to be addressed.

infra.bs Outdated Show resolved Hide resolved

<li><p>Return false if <var>aCodeUnit</var> is different from <var>bCodeUnit</var>.

<li><p>Set <var>i</var> to <var>i</var> + 1.
Copy link
Member

Choose a reason for hiding this comment

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

I've used "Increment i by x" for this, but maybe this is clearer? Another thing to settle when we do numbers.

Copy link
Member Author

Choose a reason for hiding this comment

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

"Increment" doesn't appear in Infra yet, so I'll leave it. But we do have an outstanding feature request, in #99.

infra.bs Outdated
<li><p>If <var>a</var> is a <a>code unit prefix</a> of <var>b</var>, then return true.

<li><p>Let <var>n</var> be the smallest index such that the <var>n</var>th <a>code unit</a> of
<var>a</var> is different from the <var>n</var>th code unit of <var>b</var>. (There must be such an
Copy link
Member

Choose a reason for hiding this comment

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

There is* (it's a statement of fact, not a requirement).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch. I'll go with "There has to be".

infra.bs Outdated Show resolved Hide resolved
infra.bs Show resolved Hide resolved
infra.bs Show resolved Hide resolved
@domenic
Copy link
Member Author

domenic commented May 9, 2019

Nits fixed. My preferred course of action would be closing #55 and opening a new feature request to add a "byte less than" or "byte ASCII lowercase less than" operation for byte sequences. Or, perhaps now that this general framework is in place, those could just be defined in Fetch.

@annevk
Copy link
Member

annevk commented May 10, 2019

There was also code point order for CSSOM, but okay.

@annevk annevk merged commit b522298 into master May 10, 2019
@annevk annevk deleted the sorting branch May 10, 2019 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Define string sorting by "code unit order"
2 participants