(Almost) everything is expression

Dmitry Soshnikov dmitry.soshnikov at gmail.com
Thu Nov 10 23:12:53 PST 2011


On 11.11.2011 11:07, Dmitry Soshnikov wrote:
> P.S:
>
> Regarding Dave's `do { .. }` -- we may omit `do` and just evaluate the 
> block.
>
> let a = {
>   print('doing stuff');
>   100;
> };
>
> It's of course seems ambiguous with an object initialiser (at first 
> glance), but it's only at first glance. Obviously there is a code 
> inside to evaluate. 

Though, it can be visually _really_ ambiguous with object initialisers 
in case of using labels inside the block:

let a = {a: 10; b: 20};

Nope, have to think more on this...

Dmitry.


More information about the es-discuss mailing list