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: Consistify re "elements in/of" #2941

Merged
merged 1 commit into from
Jan 11, 2023
Merged

Conversation

jmdyck
Copy link
Collaborator

@jmdyck jmdyck commented Oct 22, 2022

The spec is inconsistent on "element[s] in X" vs "element[s] of X".

In pseudocode, I count 37 "in" vs 229 "of".

So in the first commit, I change all the "in" to "of".


However, I don't entirely like the result. While:

  • "the elements of X"
  • "each element of X"
  • "an element of X"
  • "the first/last element of X"

all sound fine to me, "the number of elements of X" sounds odd.

Compare:

  • "the number of hours in a day" vs "the number of hours of a day"
  • "the number of pups in a litter" vs "the number of pups of a litter"

Also note that the status quo spec has

  • ~28 occurrences of "the number of elements in" vs
  • ~11 of "the number of elements of".

So in the second commit, I change "of" to "in" just for "the number of elements of X".

(Alternatively, we could avoid this question by instead using the phrase "the length of X". Currently we only use that for Strings.)


The net effect of the 2 commits is:

  • 11x "the number of elements of X" -> "the number of elements in X"
  • 1x "the elements in the List X" -> "the elements of the List X"
  • 2x "the last element in X" -> "the last element of X"
  • 6x "the element in X" -> "the element of X"

I've left it as two commits in case you want to look at the effect of just the first.


Historical note: PR #2152 standardized on "of" for iteration: "For each element foo of X".

@jmdyck jmdyck closed this Oct 22, 2022
@jmdyck jmdyck changed the title Editorial: Consistify re Elements of Editorial: Consistify re "elements in/of" Oct 22, 2022
@jmdyck jmdyck reopened this Oct 22, 2022
@michaelficarra michaelficarra added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jan 11, 2023
 - Change all "element[s] in" to "element[s] of"
 - Change "the number of elements of" to "the number of elements in"
@ljharb ljharb merged commit e78dfb2 into tc39:main Jan 11, 2023
@jmdyck jmdyck deleted the elements_of branch January 12, 2023 13:42
jmdyck added a commit to jmdyck/ecma262 that referenced this pull request Feb 16, 2023
PR tc39#2947 changed 6 occurrences of:
`the element of _execution_.[[EventsRecords]] whose ...`
to:
`the Agent Events Record of _execution_.[[EventsRecords]] whose ...`

But there were also 2 pre-existing occurrences of
`the Agent Events Record in _execution_.[[EventsRecords]] whose ...`
with "in" rather than "of", in {Enter,Leave}CriticalSection.

To achieve consistency, this commit changes the latter (with "in")
to match the former (with "of").
Roughly speaking, this conforms to PR tc39#2941.
ljharb pushed a commit to jmdyck/ecma262 that referenced this pull request Feb 17, 2023
PR tc39#2947 changed 6 occurrences of:
`the element of _execution_.[[EventsRecords]] whose ...`
to:
`the Agent Events Record of _execution_.[[EventsRecords]] whose ...`

But there were also 2 pre-existing occurrences of
`the Agent Events Record in _execution_.[[EventsRecords]] whose ...`
with "in" rather than "of", in {Enter,Leave}CriticalSection.

To achieve consistency, this commit changes the latter (with "in")
to match the former (with "of").
Roughly speaking, this conforms to PR tc39#2941.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change establishes editorial conventions 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