On Wed, Feb 3, 2016 at 2:41 PM, Claude Pache <[email protected]> wrote:
> > > Le 3 févr. 2016 à 20:56, John Lenz <[email protected]> a écrit : > > > > Can you reference something as to why the more obvious operators are > problematic? > > > > ?. > > That one (that I've used) must work, with the simple lookahead I've put in > the lexical grammar, in order to continue to parse `x?.3:0` as today. > > > ?[] > > ?() > > For those it is difficult for the parser to easily (i.e. quickly, without > trying and backtracking code of arbitrary length) distinguish from the > conditional operator, as in: `x ?(y - 2) + 3 : 0` Also, the difference of > precedence level between the two operators makes the use of a cover grammar > (I think) impossible. > Waldemar's example makes the problem obvious but I think we could do use, which I think is preferable to the proposed: .? (?) [?] > > > ?: > > I'm not sure what that one should be used for. (If you mean the Elvis > operator, it's out of the scope of the proposal. > yes, I meant the equivalent to: x ?: value x == null ? x : value > —Claude >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

