Existential operator (was: ||= is much needed?)

Jeremy Ashkenas jashkenas at gmail.com
Tue Jun 19 12:37:58 PDT 2012

On Tue, Jun 19, 2012 at 3:33 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>wrote:

> >  foo.bar?(args) <==>  foo.bar?.call(foo, args)
> >  fun?(args) <==>  fun?.call(undefined, args)
> How are these equivalent? Won't  fun?.call evaluate to undefined if fun is
> undefined and undefined(undefined,args) will throw...
 ... check out the compilation:


It doesn't eagerly evaluate to undefined ... the value of the *entire*
expression is undefined if the chain is broken at the existential operator.
That's much of the point of soaks:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120619/03614a18/attachment.html>

More information about the es-discuss mailing list