-
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: remove useless step of ReturnIfAbrupt expansion #1570
base: main
Are you sure you want to change the base?
Conversation
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.
Per discussion, this change looks good. Further refinements can happen in this or a future PR.
It looks like all occurrences (outside 5.2.3.3 and 5.2.3.4) match
(The argument is always an alias/metavariable, never an operation-invocation, and the Minor quibble: there's one occurrence that technically doesn't match, because it's in a one-line
but of course it would match if we made it an indented sub-block.
For E.g., There are ~100 occurrences of the form:
So it depends whether you think For If so, then there are 2 occurrences of the form:
So again, it depends. |
Yeah, 5.2.3.{3,4} seem a bit too vague for my taste. I'd prefer, for each construct, a single precise definition that covers all possible usages, rather than a few patterns whose coverage is at best questionable. However, I don't think we have the notation that would allow precise definitions, and I'm doubtful that it'd be worth introducing it. |
@jmdyck Thanks for doing the initial research! I've confirmed that all of the current usages of In my opinion, the way the shorthand notation is defined right now is unacceptably bad. I'd like to see if we could define rewrite rules for the shorthand notation that operate only on a whole step. Something like
gets rewritten to
|
That sounds great to me - essentially, turning |
I was just about to suggest something like that. Except I was going to suggest it for the expansion of |
Either way works for me. |
Seems nice to keep the connection and add better shorthand for ReturnIfAbrupt. |
I opened a PR for better ReturnIfAbrupt definition in #1573. |
I think we should merge this without waiting for a resolution on #1573. It's an objective improvement for the time being. |
bcd2a81
to
e42a39a
Compare
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'm a little hesitant to remove this step when so many of the existing usages of ReturnIfAbrupt
(via the shorthand, specifically) do not fall into one of the enumerated cases and therefore must currently be understood by trying to figure out what the intent would be based on the cases which do exist. That is to say, while this step is useless in theory, in practice it serves to help a reader understand how ReturnIfAbrupt
is used more generally, which is an act of interpretation which is necessary because we have not actually given a complete definition.
But sure, I guess.
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 actually feel like this should be blocked on #1573. Right now, even though that step is just wrong, you can kinda get at the intention through the wrongness: when expanded via ? Foo()
, the intention is to return the unwrapped CR.[[Value]]
, even though that's not what the scoping of hygenicTemp says. If we remove this strictly-speaking useless line, I think the interim state of the spec is worse where folks will start asking if ? Foo()
in fact unwraps normal completions.
Okay that's fair, thanks for the reviews. We'll hold off until #1573 can fix this (literal) nonsense. |
3d0c24c
to
7a79833
Compare
Since "hygienicTemp is ephemeral and visible only in the steps pertaining to ReturnIfAbrupt", there's no reason to set it in the final step.