-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Examine+reduce the diversity of forms in PR #2877 #2972
Conversation
Okay, now that I have a better idea of editors' preferences, I've dropped the "descriptions" commits. Instead, since this PR is labelled "establishes editorial conventions", I've attempted to formulate a convention and then supply commits to bring things into line. We often need to express that the value of an alias (or other meta-expression) belongs to some target set of values. E.g.,
In both of the above examples, the target set of values is expressed the same way ("a String"). But things get interesting when the target set cannot be expressed that simply. For example,
(I.e., one uses "either" and the other doesn't.) So here, we consider when the target set is a union of smaller sets, expressed as a disjunction of descriptive terms, which I'll generalize as For example, a
The wording we use for the disjunction depends on its context, specifically what precedes it. (1) When it's preceded by prose (typically the word "is")... The conventional forms are:
E.g.:
[The 4 new commits bring the spec in line with this convention.] (2) Otherwise, the disjunction is preceded by:
Here, the conventional forms don't use "either" or "one of":
E.g.:
But if
For example,
By using 'either', we can say (respectively):
(Similarly, The version with the comma is helpful when the first
[No commits needed.] |
(Looks like ecmarkup doesn't like |
@jmdyck That summary LGTM. |
I think the "one of an X" form sounds strange. From the editor call discussion, the following would sound more natural. A disjunct is either a type with >1 inhabitant (styled as X below) or a constant (styled as "foo" below).
|
0ffbd65
to
4f2688e
Compare
Okay, I made some more changes and then re-divided things with respect to @syg's bullets.
2 commits, inserting "either" to a few cases that didn't have a prefix (5 cases with two types, 3 cases with two constants).
1 commit, swapping the order in 1 case.
2 commits, inserting "either". The second commit is where the disjunction is after "is not", in case you want to consider negatives differently.
3 commits,
Currently, the spec has only 5 occurrences of this, and they're all 'degenerate', in that either the number of types or the number of constants is 1.
Personally, I think the changes of that last commit aren't an improvement. Note that all 3 cases are embedded within a "normal completion" type, so e.g., the status quo's |
From discussion this all looks good except in the case of mixing types and constants, where we'd prefer to mix them in a single list (still with the constants at the end) and use (Also I'll need to update ecmarkup to understand "one of".) |
Okay, I've dropped my last commit, so those 3 cases have reverted to the format you describe. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks for bearing with all the requests
f36a44e
to
727036f
Compare
> Composing a condition from sub-conditions... > > ... when there are only 2 sub-conditions: > > 229 {COND} and {COND} > 80 {COND} or {COND} > 4 {COND} unless {COND} > vs > 2 {COND}, or if {COND} > 1 {COND}, or {COND} > 1 {COND}, unless {COND} > vs > 1 either {COND} or {COND} This commit reduces the variety slightly: - `{COND}, or {COND}`: Change `or` to `or if` - `either {COND} or {COND}`: Delete `either`
> Composing a condition from sub-conditions... > > ... when there are 3+ sub-conditions: > > 1 {COND}, {COND}, or {COND} > 8 {COND}, {COND}, and {COND} > 6 {COND}, {COND}, {COND}, and {COND} > vs > 5 {COND} and {COND} and {COND} > 1 {COND} or {COND} or {COND} > 1 {COND} or {COND} or {COND} or {COND} This commit converts the latter style into the former. ---- I considered the opposite direction, but found that it resulted in at least one ambiguity, e.g. `If there exists <something> such that {COND} and {COND} and {COND}` could be `If (there exists <something> such that {COND}) and {COND} and {COND}` or `If (there exists <something> such that {COND} and {COND}) and {COND}` or `If (there exists <something> such that {COND} and {COND} and {COND})` Note that, regardless of the style chosen for 3+ sub-conditions, a similar ambiguity would already exist for 2 sub-conditions, e.g.: `If there exists <something> such that {COND} and {COND}` However, it turns out that the spec has no conditions of that form. (At least, not in algorithms.)
> (And while I'm here, conditions that mix operators without parens: > > 1 {COND} and {COND} or {COND} and {COND} > 3 {COND} and {COND}, or if {COND} and {COND} > 2 {COND} and {COND}, or {COND} and {COND} > 2 {COND} or {COND} <ins>and {COND}</ins> > 1 {COND} unless {COND} and {COND} > 2 {COND}, or if {COND} and {COND} > > ) This commit changes - 1 `{COND} and {COND} or {COND} and {COND}` to the ", or if" form. The "unless" (in WordCharacters) is probably okay. It's in an Assert, so isn't normative anyway. The 2 `{COND} or {COND} <ins>and {COND}</ins>` (in Annex B's early error rules for ClassRanges) are weird. I think there's a bigger refactor that will eliminate them.
(duplicates the first commit in PR tc39#2995)
8927e56
to
85dc48d
Compare
(except to disambiguate) See tc39#2972 (comment)
At the latest editors call, I was invited to expand on #2877 (comment), giving specific cases instead of just counts. That's what this PR does.
Most of the commit messages have a relevant excerpt from that comment and some discussion.