-
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
! shorthand for completion record [[Value]] extraction is unnecessary #1572
Comments
The primary purpose of Also, some people would love to make obsolete the paragraph at the end of §5.2.3.1 Implicit Completion Values you cited, through the systematic use of the |
I'm a bit unclear what the issue is - indeed, the |
(And some people would like to make it obsolete via somewhat different means.) |
@ljharb Yes, we should either fully buy into that implicit unwrapping everywhere or (my preference) drop that paragraph and fix up anywhere that is relying on it. If the latter, we should probably move the @jmdyck Care to elaborate? |
I’m fine with the implicit unwrapping in general, but i like it being explicit in the desugaring of ? and ! |
I got the feeling that newly written spec text has fairly consistently used !. I’m in support of marking all implicit unwrappings with !. |
I think there is a useful distinction between operations which never return abrupt completions and those which do sometimes but don't under the particular conditions under which they are invoked in some algorithm. Perhaps we could distinguish the two somehow? For example, we could do away with the first paragraph of 5.2.3.1 so that the first type of algorithm could return unwrapped values and would not need |
I think distinguishing those should be done at the declaration site, not the call site. See #253. |
@michaelficarra: "@jmdyck Care to elaborate?" The implicit conversion clause only applies to normal completions, so one way to eliminate that clause is to eliminate normal completions. See issue #497. |
Yes, that's definitely a useful distinction, and I agree with @domenic that it should be made at the declaration site (see e.g. PR #545). I think it might be useful to also make the distinction at the call site (see #486), but I don't know that anyone else does. |
@jmdyck I think it would be useful to make it at the call site as well as the declaration site. The thing I am envisioning is:
And then get rid of all implicit conversions, both from and to completion records (except possibly as in the footnote below). This is similar to #497, except without the mixing of completion records with non-completion values. I'm sure someone has proposed this before. *: I'm flexible on this last part; we could instead have spec text which says that |
In §5.2.3.4 ReturnIfAbrupt Shorthands, we define a shorthand
!
that's not really related to ReturnIfAbrupt. This shorthand asserts that the completion record is a normal completion and extracts its[[Value]]
. But at the end of §5.2.3.1 Implicit Completion Values, we sayI think we should either
!
shorthand or explicit[[Value]]
extraction throughout the spec, or!
shorthand, its usages, and any explicit[[Value]]
extractionThe text was updated successfully, but these errors were encountered: