-
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: clarify spec values that have identity and its implications #2821
Conversation
|
||
<emu-clause id="sec-identity"> | ||
<h1>Identity</h1> | ||
<p>In this specification, the word “is” is used to identify two values, as in “If _bool_ is *true*, then”. This identification is different when applied to values which have identity than it is when applied to those without identity.</p> |
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.
I would maybe suggest to use two different wordings: "is" or even "equals" for values (without identity), "is same as" for objects (values with identity).
Does the spec actually compare objects that often? I can only think of SameValueNonNumeric
.
</emu-clause> | ||
|
||
<emu-clause id="sec-identity"> | ||
<h1>Identity</h1> |
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.
I wonder if this whole section should be part of the ECMAScript Data Types and Values chapter, not the Algorithm Contentions one - it's describing semantics of objects, not just a notational convention.
Updated based on @syg's feedback. @tc39/ecma262-editors Please take another look. |
2f8081d
to
f4f556f
Compare
Thoughts on "characteristics" as an alternative to "qualities"? |
f4f556f
to
06520c2
Compare
06520c2
to
bdf6f83
Compare
This comment was marked as resolved.
This comment was marked as resolved.
No. The spec-internal List type and the ES language Object type both have identity, and neither are Records, for example. |
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.
Some of these uses of "any of" do not read naturally to me. I've commented on a few representative cases but there's several others.
spec.html
Outdated
</emu-alg> | ||
<emu-grammar>ExportDeclaration : `export` `default` ClassDeclaration</emu-grammar> | ||
<emu-alg> | ||
1. Let _names_ be BoundNames of |ClassDeclaration|. | ||
1. Let _localName_ be the sole element of _names_. | ||
1. Return a List whose sole element is the ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _localName_, [[ExportName]]: *"default"* }. | ||
1. Return a List whose sole element is an ExportEntry Record { [[ModuleRequest]]: *null*, [[ImportName]]: *null*, [[LocalName]]: _localName_, [[ExportName]]: *"default"* }. |
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.
I am ok with this but would mildly prefer to factor the record out to an alias, so we could say Let _entry_ be a new ExportEntry Record { ... }
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.
Agreed. This was kind of an intermediate step toward handling articles. Remember, this is still in draft!
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.
Shouldn't the lists of kinds of values that have/do not have identity be exhaustive?
@michaelficarra All of the editorial choices in #2821 (comment) seem to be strictly speaking unrelated to nailing down a definition of identity. It'd be easier to review some of those as separate PRs. |
5e966e8
to
d0b7483
Compare
Dropped all the editorial changes I've been working on, cleaning up how comparisons are done. Now this just includes the identity section. I'll open up other PRs for the comparison changes. Marked as ready for review. |
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.
This is great. lgtm!
Opened as draft since I only have the prose for now. Once we get this part agreed on and settled, I'll audit for uses of comparison, mutation, article choice, construction, etc.
New section rendering: https://ci.tc39.es/preview/tc39/ecma262/pull/2821#sec-identity
Fixes #2405.