Arrow binding

Axel Rauschmayer axel at rauschma.de
Tue Apr 24 14:39:59 PDT 2012


> I believe that we could grammatically use ArrowBody as the body of concise methods in object literals and classes.  In that case, Dave's example could be expressed as:
> 
>     box = {
>         _value: 0,
>         unbox() ()-> this._value,
>         setbox(v)  this._value = v 
>     }

That would be very nice. And it would be a perfect solution for the completion value issue: If you want to implicitly return the completion value, use an expression body.

Is there a typo in the code? I’d expect it to be:

    box = {
        _value: 0,
        unbox() this._value,
        setbox(v)  this._value = v
    }

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

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


More information about the es-discuss mailing list