-
Notifications
You must be signed in to change notification settings - Fork 15
Explainer: Add goal about semantic nonambiguity #6
Comments
This issue is moot, because Proposal 1 is stable with parentheses.
However, this proposal still has an advantage in that it forces the writer to make explicit which of these reasonable alternatives do they mean by |
In F#, |
@mAAdhaTTah: Ah. Why is it an error? The syntax of |
That ambiguity is part of the reason; That's what I would like it to be, anyway. I'm drawing that interpretation from here: tc39/proposal-pipeline-operator#85 |
Good to know; thanks! I will update the wiki table later today. |
An advantage that this proposal has is that parentheses can never change the meaning of a code without giving an early error.x |> (await #)
is the same asx |> await #
, andx |> (await y)
andx |> await y
are both early errors that require the developer to disambiguate betweenx |> (await y)(#)
andx |> await y(#)
. This should be noted in Goals and in the Motivation, Core Proposal too, as well as the pipeline-operator wiki.Edit: That advantage is moot. However, this proposal still has an advantage in that it forces the writer to make explicit which of these reasonable alternatives do they mean by
x |> foo
:x |> foo(#, y)
,x |> foo(y, #)
, andx |> foo(y)(#)
. This is also important, so I’m reusing this issue to track better explaining this in § Goals, in § Motivation, Core Proposal, and in the wiki. See #2 (comment).The text was updated successfully, but these errors were encountered: