Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upEditorial: usage of "!" #1097
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
Feb 10, 2018
Member
I would expect and desire every abstract operation to be prefixed by a ? or a ! - to me, the lack of a prefix means that it returns a Completion Record, which means the algorithm must be checking whether it’s abrupt or not.
That the number of changes to achieve this consistency is large doesn’t, to me, detract from the value of the change.
|
I would expect and desire every abstract operation to be prefixed by a ? or a ! - to me, the lack of a prefix means that it returns a Completion Record, which means the algorithm must be checking whether it’s abrupt or not. That the number of changes to achieve this consistency is large doesn’t, to me, detract from the value of the change. |
jmdyck
referenced this issue
Feb 10, 2018
Merged
Editorial: add a SetFunctionLength abstract operation #1096
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jmdyck
Feb 10, 2018
Collaborator
to me, the lack of a prefix means that it returns a Completion Record, which means the algorithm must be checking whether it’s abrupt or not.
Indeed, if you take the view that every operation returns a completion record, then you have to use '?' or '!' if you want to explicitly inline-extract the [[Value]]. (Of course, you could also rely on implicit [[Value]]-extraction.)
However, I don't subscribe to that view.
Indeed, if you take the view that every operation returns a completion record, then you have to use '?' or '!' if you want to explicitly inline-extract the [[Value]]. (Of course, you could also rely on implicit [[Value]]-extraction.) However, I don't subscribe to that view. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Feb 10, 2018
Member
I like the idea of maintaining metadata somewhere about which abstract operations return completion records (i.e., which may throw) and which do not. cc @domenic who I believe suggested this in the past.
This issue reminds me a bit of tc39/proposal-bigint#10 : There are some concepts for when things sort of implicitly become completion records and when not, and it's not immediately obvious to everyone what's going on.
|
I like the idea of maintaining metadata somewhere about which abstract operations return completion records (i.e., which may throw) and which do not. cc @domenic who I believe suggested this in the past. This issue reminds me a bit of tc39/proposal-bigint#10 : There are some concepts for when things sort of implicitly become completion records and when not, and it's not immediately obvious to everyone what's going on. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Dang, I forgot about #486. I'll close this as a duplicate of that. |
jmdyck commentedFeb 10, 2018
(Picking up from #1096 (comment).)
For an operation (abstract, syntax-directed, or type-directed), we can distinguish two possibilities:
For convenience here, we can refer to "can-throw operations" and "can't-throw operations". (There are abrupt completions other than throw-completions, but the latter appear to be of more interest.)
For a can-throw operation, we expect that generally, its invocations will be prefixed by "!" or "?", depending on whether or not the circumstances of the invocation guarantee that the return value won't be an abrupt completion.
But the question raised in PR #1096 relates to can't-throw operations: should their invocations be prefixed by "!" ?
Some numbers: (These are my counts. Your mileage may vary.)
The spec has 4247 operation-invocations. Of these,
Of those prefixed with "!",