Wouldn't `.?` as an infix operator be unambiguous, compared to `?.`? There's no place other than decimal literals where this would be legal today, and decimal literals already require either parenthesis or an extra dot to perform a property access in any event. With that lexeme, `x.?1:y` would be unambiguously an error. `1.?x:y` is unambiguously a conditional, while `1..?x:y` is unambiguously a null-propagating property access on the numeric literal `1.`.
Ron -----Original Message----- From: es-discuss [mailto:[email protected]] On Behalf Of Brendan Eich Sent: Monday, April 6, 2015 3:35 PM To: Matthew Robb Cc: es-discuss Subject: Re: Existential Operator / Null Propagation Operator Yeah, and it would line up with cover grammar needed for refutable-by-default patterns. /be Matthew Robb wrote: > > On Mon, Apr 6, 2015 at 5:42 PM, Brendan Eich <[email protected] > <mailto:[email protected]>> wrote: > > Did you keep backward compatibility? `x?.1:y` must continue to work. > > > This is why I suggested a leading operator (`?a.?b()`) because it > seems like it would have the least potential for conflict with > existing valid syntax > > > > - Matthew Robb _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

