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: remove %Generator% and %AsyncGenerator% in favor of dotted forms #2065

Merged
merged 1 commit into from
Aug 27, 2020

Conversation

ljharb
Copy link
Member

@ljharb ljharb commented Jun 24, 2020

Fixes #2023.

#2056 will need to be rebased after this lands.

@ljharb ljharb requested review from syg, michaelficarra, bakkot, jmdyck and a team June 24, 2020 23:18
@ljharb ljharb self-assigned this Jun 26, 2020
@ExE-Boss
Copy link
Contributor

I think we should keep the <dfn>s in the dotted forms.


Also, this will need to be rebased on top of #2059.

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated
Comment on lines 38973 to 39015
<li>is the value of the *"prototype"* property of %GeneratorFunction%.</li>
<li>is the intrinsic object <dfn>%Generator%</dfn> (see Figure 2).</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree that it's redundant to say it's both:

  • the initial value of the "prototype" property of %GeneratorFunction%, and
  • the intrinsic object %GeneratorFunction.prototype%.

But I'm wondering why you chose to keep the first and remove the second, rather than vice versa. (We've established the %Foo.bar% notation, so why not use it here?)

Ditto the deletions under:

  • "The AsyncGeneratorFunction prototype object"
  • "The Generator Prototype Object"
  • "The AsyncGenerator Prototype Object"

Copy link
Member Author

Choose a reason for hiding this comment

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

%GeneratorFunction.prototype% only works because the prototype property is already defined; in other words, the first of those two is the one that's actually required. The second one isn't necessary, I suppose, but is nice for clarity.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the spec says "X is %Foo.bar%", then by definition, that means that if I were to access the 'bar' property of '%Foo% prior to any ECMAScript code being evaluated, I would get X. To me, this seems equivalent to saying that X is the initial value of the 'bar' property of %Foo%. You're saying these aren't equivalent?

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'm saying that relying on that kind of inference isn't something I'd prefer; %Foo.bar% works because it's the initial value of bar on Foo, which imo should have to be defined somewhere.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't 25.2.2.2 Generator.prototype enough of a definition?

Copy link
Member Author

Choose a reason for hiding this comment

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

25.2.2.2 there doesn't actually have an explicit link that I can see to 25.2.3, "the GeneratorFunction prototype object"; 25.2.3 has "is the value of the "prototype" property of %GeneratorFunction%." which is the link.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused, so I'll back up. Earlier, I asserted the equivalence of the two statements:

  • X is %Foo.bar%
  • X is the initial value of the bar property of %Foo%.

You didn't deny that they were equivalent, but you said that the first relies on a kind of inference (on the part of the reader, presumably) that you didn't prefer. I don't really understand that, but I can probably accept it as an editorial preference.

So, to clarify the specifics of this preference, 2 questions:

  1. Would it make a difference for you if the statement were the other way round:
    %Foo.bar% is X ?

  2. Do you expect to eventually remove all statements of the form The initial value of `Foo.prototype` is %Foo.prototype%., or do any of them serve a purpose?

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 saying that they're not equivalent unless the second one exists.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To clarify, when you say "the second one exists", do you mean "somewhere in the spec establishes that %Foo% has a bar property"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Something that establishes that Foo has a bar property, and that the value of that property is "the object in question" (ie, "the Array prototype object", or whatever)

Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

Based on your suggestion in #2059 (comment), the wording:

<li>is the initial value of the *"bar"* property of %Foo%.</li>

Is redundant and should be replaced with the simpler:

<li>is <dfn>%Foo.bar%</dfn>.</li>

Which has the added bonus of supporting auto‑linking for the dotted intrinsics.

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

ljharb commented Jul 6, 2020

Yes; but this PR shouldn't be updated to that wording until #2059 lands.

spec.html Outdated Show resolved Hide resolved
@ljharb ljharb requested review from syg and jmdyck July 16, 2020 06:28
Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

This wasn’t rebased correctly.

See also:


P.S.: Please keep the emu‑xref in the definition of the Generator Function Prototype Object:

(See <emu-xref href="#figure-2"/>)

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

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

updated

@littledan
Copy link
Member

This change seems to increase verbosity and make it harder to tell what the spec is talking about. What is the motivation?

@ljharb
Copy link
Member Author

ljharb commented Jul 19, 2020

@littledan overall, the editors decided that we should only have one preferred way to refer to every intrinsic, and that the shortest (and dotted, when applicable) form would be preferred. Regarding %Generator% and %AsyncGenerator%, see #2023 (comment); during the editor call the consensus was to remove these forms, particularly because we found the names misleading.

Copy link
Collaborator

@jmdyck jmdyck left a comment

Choose a reason for hiding this comment

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

This PR leaves dangling references...

  • to %Generator% in Properties of the GeneratorFunction Prototype Object, and
  • to %AsyncGenerator% in Properties of the AsyncGeneratorFunction Prototype Object.

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
ljharb added a commit to ljharb/ecma262 that referenced this pull request Jul 26, 2020
@ljharb
Copy link
Member Author

ljharb commented Jul 26, 2020

All updated, including

@ljharb ljharb requested a review from jmdyck July 26, 2020 17:59
Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

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

ljharb commented Jul 26, 2020

I'm not convinced we want to preserve auto-linking for something that's not actually a well-known intrinsic anymore.

@michaelficarra

This comment has been minimized.

@michaelficarra

This comment has been minimized.

@ljharb
Copy link
Member Author

ljharb commented Aug 5, 2020

Now that #1948 has consensus and has been merged, this PR is no longer normative.

ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 5, 2020
ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 5, 2020
@ljharb ljharb requested a review from a team August 5, 2020 22:32
@bakkot
Copy link
Contributor

bakkot commented Aug 9, 2020

@littledan I am personally in favor of this change because I cannot for the life of me keep track of which is %Generator%, and which is %GeneratorFunction%, whereas %GeneratorFunction% vs %GeneratorFunction.prototype% is unambiguous.

spec.html Outdated
@@ -26311,7 +26271,7 @@ <h1>Object.preventExtensions ( _O_ )</h1>

<emu-clause id="sec-object.prototype">
<h1>Object.prototype</h1>
<p>The initial value of `Object.prototype` is %Object.prototype%.</p>
<p>The initial value of `Object.prototype` is the Object prototype object.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

This and many of the subsequent changes seem unrelated to this PR; is this a rebase conflict? If it's intentional, I'd ask that these changes go into their own PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was intentional to make everything consistent. I can pull them out into another PR tho.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that it should probably be done in its own PR/commit.

Copy link
Member Author

Choose a reason for hiding this comment

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

@bakkot i extracted it to #2131 and rebased this one on top of it, so you can review just the commit for this PR separately. If you'd prefer to wait to review this one until after #2131 lands, that's fine too.

Copy link
Collaborator

@jmdyck jmdyck left a comment

Choose a reason for hiding this comment

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

Changes look okay to me.

Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

For consistency with current definitions, the <dfn> for the intrinsic name should come before “is an ordinary object”.

spec.html Outdated Show resolved Hide resolved
spec.html Outdated Show resolved Hide resolved
ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 10, 2020
ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 10, 2020
@ljharb ljharb requested a review from bakkot August 10, 2020 23:53
ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 11, 2020
ljharb added a commit to ljharb/ecma262 that referenced this pull request Aug 25, 2020
Copy link
Contributor

@ExE-Boss ExE-Boss left a comment

Choose a reason for hiding this comment

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

This shouldn’t yet close #2023, that should only be done by #2056.

@ljharb
Copy link
Member Author

ljharb commented Aug 26, 2020

@ExE-Boss the editorial convention is established by this PR; removing the legacy ones entirely is a cleanup step after that's resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editorial convention for referring to intrinsics
7 participants