-
Notifications
You must be signed in to change notification settings - Fork 111
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
Spec |> await
#85
Spec |> await
#85
Conversation
I'm working on implementing this in babylon. Is the parsing issue you mention actually a problem? I'm actually wondering if banning So this: x |> fetch
|> await y
|> process would parse as: x |> fetch
|> await;
y |> process; Would this be too surprising behavior? The other thought was making it a @zenparsing I get what you mean by "ad-hoc" rules 😀. |
@mAAdhaTTah I don't understand how that parse would happen. An expression followed by another expression, with a space in between, is a SyntaxError--ASI is only triggered by newlines. |
@littledan Oh right, ok then. Is lookahead after a |> await
b would be a |
Seems like, if we merge this patch, it'll be in a branch that @mAAdhaTTah would maintain. Is that right? If so, should we close this PR? |
@littledan Yeah, I'm going to borrow this change for the F#-style spec, which I'll maintain in our fork, but since we designed the current minimal proposal to ban await, this can't be merged until we make a decision on which proposal we're adopting. |
@mAAdhaTTah Are you planning on writing an explainer in your fork that focuses on the vision of the F# proposal, and linking to this from the explainer in this repository? |
@littledan Yeah, I'm working on that now, but I haven't committed anything yet. |
This is implemented here. |
Great, closing this PR for now then; we can reopen if we select the F# proposal. |
This specifies the third of the options here (I think).
I believe the inclusion of
GetValue
actually is observable because it means the running execution context is not suspended if the LHS is an abrupt completion, which is as I'd expect.I'd be happier if we could prevent
from parsing as
(instead having it just be an error), but I can't see good way of doing that off the top of my head. The reason I want this is because it amounts to a "phantom" NoLineTerminatorHere restriction in
AwaitExpression
s which only applies in pipelines, which I don't really like.