The Existential Operator

Axel Rauschmayer axel at rauschma.de
Thu May 22 10:39:12 PDT 2014


> Dmitry Soshnikov wrote:
>> 
>> Will the "Existential Operator" for properly accessors be something interesting to consider for ES7 spec? Currently CoffeeScript uses it well.
> 
> Please see
> 
> http://esdiscuss.org/topic/sept-18-tc39-meeting-notes#content-2
> 
> and find "ARB: This is non-compositional".

David seems to suggest a compositional version: `o?.p?.q?.r`

I’m assuming that the left-hand side of `value?.prop` is an arbitrary value and that the property access is only made if that value is neither `undefined` nor `null`. AFAICT that’s also how CoffeeScript’s existential operator works.

I’m ambivalent about it, though: it would be useful, but would also add complexity to the language.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140522/8b867575/attachment.html>


More information about the es-discuss mailing list