(Almost) everything is expression

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Nov 11 09:34:10 PST 2011


On Nov 11, 2011, at 7:39 AM, Neil Eades wrote:

> On 11 November 2011 15:33, Mark S. Miller <erights at google.com> wrote:
> Insist on enclosing parens, since 
>   "(" introductory-token
> is not otherwise legal
> 
> let a = ({
> 
>  print('doing stuff');
>  100;
> });
> 
> Even the last is now easily unambiguous. 
> 
> 
> And is this not clearer than 
> 
> let a = {||
> 
>  print('doing stuff');
>  100;
> };


that needs to be:

let a = {||

 print('doing stuff');
 100;
}();  //<------- note the ()

other wise the value of a is a function, rather than 100

Allen

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


More information about the es-discuss mailing list