15:54
<jschoi>

ljharb: Regarding https://github.com/tc39/proposal-pipeline-operator/issues/262#issuecomment-1036323490, source |> a + (# |> b + #) is valid. It is the same as source |> a + (b + #) and a + (b + source).

However, source |> (a + # |> b) + # is invalid, because |> b does not contain any topic reference.

15:55
<jschoi>
Also, source |> a => # + a |> output(#) is invalid because arrow functions (and all other non-pipe AssignmentExpressions) must be parenthesized in pipe bodies to prevent confusing grouping.
16:02
<ljharb>
Thanks, the rules are straightforward but that doesn’t mean contrived examples are intuitive :-)
18:46
<jschoi>

We have banned a |> # ? c : d and require parentheses: (a |> #) ? c : d or a |> (# ? c : d).

I think we should also ban a ? b : c |> # and require parentheses: (a ? b : c) |> # or a ? b : (c |> #). This would add an early error to ConditionalExpression. I plan to add this to the spec later if nobody else has objections.

18:55
<TabAtkins>
yes
19:14
<jschoi>
Should we ban a = b |> # and require (a = b) |> # or a = (b |> #)?
19:14
<jschoi>
And should we ban a => b |> # and require (a => b) |> # or a => (b |> #)?
19:16
<jschoi>
And should we ban yield a |> # and require (yield a) |> # or yield (a |> #)?
19:17
<jschoi>
My inclination is no: the ternary operator is special and has special opportunity for confusion, but =, =>, and yield are okay to have “looser” precedence than |>.
19:18
<jschoi>
(Note: We do already ban all three of these operators in pipe bodies: a |> b = #, a |> b => #, and a |> yield # are all SyntaxErrors.)
19:28
<TabAtkins>
Agree on all counts; those all read reasonably to me as the head of statements (assuming that for all of them the pipe binds tighter, producing the second parenthesized example)
19:33
<jschoi>
Yeah.
19:33
<jschoi>

The precedence relationships between yield, =, =>, and ? : are already a mess, due to the weird LHSes of = and =>, as well as ? :’s being ternary.

1 ? x = 2 : 3 groups as 1 ? (x = 2) : 3 and 1 ? x => 2 : 3 groups as 1 ? (x => 2) : 3. But x = 1 ? 2 : 3 is x = (1 ? 2 : 3) and x => 1 ? 2 : 3 is x => (1 ? 2 : 3). The whole concept of “precedence” breaks down at this level…so I’m not sure how to explain where |> fits in in laypersons’ terms (let alone explaining how yield, =, =>, and ? : in such terms).

21:49
<jschoi>
Regarding the topic token: Based on https://github.com/tc39/proposal-record-tuple/issues/10#issuecomment-1036648269, it seems like ljharb would push back against # and @@. If this is strongly felt, it seems like ^^ and %% may be the top contenders (or at least the least offensive) within the Committee.
22:09
<ljharb>
i haven't decided how strong i feel about it, but i don't think @ is better than #
22:10
<ljharb>
i do prefer a single token over a double one tho