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: replace steps embedded in lookup tables with more typical algorithms #2915

Merged
merged 1 commit into from
Nov 2, 2022

Conversation

michaelficarra
Copy link
Member

This will help us catch editorial errors (it already caught 1) and IMO reads better by allowing for other groupings (such as by output in ToBoolean).

I'd recommend reviewing before/after rendering instead of reading the changeset.

There's probably more opportunities to replace tables, but this is a good start.

@michaelficarra michaelficarra added editorial change editor call to be discussed in the next editor call labels Sep 27, 2022
@ljharb
Copy link
Member

ljharb commented Sep 27, 2022

so many claps; this is awesome

@bakkot
Copy link
Contributor

bakkot commented Sep 27, 2022

This seems to me to be worse; I'd mildly prefer to leave as-is.

@ljharb
Copy link
Member

ljharb commented Sep 27, 2022

Worse how? Algorithm steps are so much clearer imo than a table.

@bakkot
Copy link
Contributor

bakkot commented Sep 27, 2022

I find the table easier to read /shrug

@michaelficarra
Copy link
Member Author

I'm actually really happy with this change. It exceeded my expectations.

@jmdyck
Copy link
Collaborator

jmdyck commented Sep 27, 2022

The ids of the former <emu-table> elements should maybe become oldids on the respective <emu-clause> elements.

@michaelficarra
Copy link
Member Author

@jmdyck Good point. Done.

@syg
Copy link
Contributor

syg commented Sep 28, 2022

I think the algorithmic steps here help clarity over tables, especially when reviewing implementations. It'd also be nice to have this be precedent setting as editorial style to not loop over tables in algorithmic steps. To wit I'd like to tell 404 proposal authors to stop doing stuff like step 17 here in the Intl.DurationFormat proposal.

@bakkot
Copy link
Contributor

bakkot commented Sep 29, 2022

I'm fine with this approach, then.

@michaelficarra michaelficarra added ready to merge Editors believe this PR needs no further reviews, and is ready to land. and removed editor call to be discussed in the next editor call ready to merge Editors believe this PR needs no further reviews, and is ready to land. labels Sep 30, 2022
@michaelficarra
Copy link
Member Author

@syg @bakkot Can I get a review for correctness then?

@michaelficarra michaelficarra requested a review from a team September 30, 2022 17:51
Copy link
Contributor

@bakkot bakkot left a comment

Choose a reason for hiding this comment

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

LGTM other than nits.

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
@michaelficarra
Copy link
Member Author

@bakkot Addressed comments.

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

spec.html 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 Nov 1, 2022
</emu-table>
<emu-alg>
1. If _argument_ is a Boolean, return _argument_.
1. If _argument_ is any of *undefined*, *null*, *+0*<sub>𝔽</sub>, *-0*<sub>𝔽</sub>, *NaN*, *0*<sub>ℤ</sub>, or the empty String, return *false*.
Copy link
Collaborator

Choose a reason for hiding this comment

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

PR #2877 proposes "any of" used this way, but the current spec doesn't use it. Instead, the current spec would say:

  • _argument_ is *undefined*, ...
  • _argument_ is either *undefined*, ...
  • _argument_ is one of *undefined*, ...

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm okay with this. It's informal language.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's informal language.

It is, but that's true of most of the spec. Every "consistent phrasing" PR changes informal language. So it seems like "informal language" can't be a reason to not aim for consistency. So why bring it up here?

Now, if you were to say "Yeah, it's an anomaly, but #2877 will take care of it soon, so it's not worth fixing here," I'd find that less puzzling.

Copy link
Member Author

Choose a reason for hiding this comment

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

@jmdyck I am aiming for consistency, but am okay with more inconsistency for the time being (in informal language) if it's heading in the direction we want to go, as here.

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.

5 participants