15:37
<TabAtkins>
Sorry, I clicked Yes on the invite but didn't actually ping the room - yeah, this morning is great.
16:05
<TabAtkins>
@room just in case anyone else is joining, meeting is starting now
16:06
<TabAtkins>
@room just in case anyone else is joing, meeting is starting now
16:43
<TabAtkins>
meeting notes: https://github.com/tc39/proposal-pattern-matching/issues/332
17:01
<rbuckton>

Regarding the contextual keyword issue, it's not that having both prefix and infix contextual keywords is impossible, but that they introduce complexity that must be managed, and that complexity could easily grow out of control. When new syntax would introduce an ambiguous parse, we must always choose an approach that favors backwards compatibility.

Given the example:

for (using is of and [not/a+"/g]; b++; [/"/g, 5])

We would have to break down the grammar to align with ECMAScript syntax roll-out:

  • for..of shipped before using
  • using will probably ship before is

Prior to pattern matching, the above parse would treat is as an identifier and and [not/a+"/g]; b++; [/"/g, 5] as an expression. Therefore we would need to maintain that behavior. As waldemar points out, this is a complex issue that will resurface each time a proposal seeks to add a new feature. Unfortunately, I don't think just choosing ~= is a solution to the overarching problem. There are a limited set of punctuators, and combining punctuators in more and more obscure ways will do little to convey their meaning, whereas contextual keywords give us a far wider space for future proposals to leverage. IMO, finding solutions to make it easier to address the prefix/infix complexity, such as automated validators, may be worth pursuing.

17:26
<TabAtkins>
I'm still giggling over the fact that for(of of of) is valid today.
17:26
<TabAtkins>
var of = [1,2,3];
for(of of of) console.log(of);
19:19
<ljharb>
personally i think we won't be adding so many keywords of either type that the complexity is a problem
19:46
<TabAtkins>
The issue isn't convincing you, tho, it's convincing the committee.
20:39
<ljharb>
very true. but i'm hoping that "there's a list of ~10 exceptions" complies with the priorities of constituencies stuff given that it makes the language better, is convincing