Existential Operator / Null Propagation Operator

Matthew Robb matthewwrobb at gmail.com
Mon Apr 6 19:49:41 UTC 2015

On Mon, Apr 6, 2015 at 3:19 PM, Kevin Smith <zenparsing at gmail.com> wrote:

> Although not strictly ambiguous with conditional expressions, `fn ? ()`
> would require the use of YACG (yet another cover grammar).
> Also, what about computed property names?  For example:  `obj ?
> [Symbol.iterator]`.  I'm not sure that even YACG will help here.

​I have two thoughts:

1. Could the language allow for a prefix operator instead (AKA 'The Maybe
        `?a.b` and `?obj()` and `?obj[Symbol.iterator]`

2. ​You could make the postfix operator `?.` which would be ugly but dodge
the above issues:
        `obj?.()` and `obj?.[Symbol.iterator]`

- Matthew Robb
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150406/5fb40ac6/attachment.html>

More information about the es-discuss mailing list