Block lambda grammar: BlockArguments

Herby Vojčík herby at mailbox.sk
Mon Jan 16 06:20:36 PST 2012



Lasse Reichstein wrote:
> On Mon, Jan 16, 2012 at 2:14 PM, Herby Vojčík<herby at mailbox.sk>  wrote:
>> Thank you, it helped.
>>
>> It is the fact that in ES up till now, {} block were always delimited by a

{} blocks which are parts of the same control structure.
I did not talk about free blocks, but about bound blocks.
Sorry if it was not clear.

>> keyword (if/else is probably the only case when two blocks were present). So
>> it is not a bad idea to retain it.
>
> I believe it's perfectly valid to write blocks (for no particular
> reason) without any keyword.
> I.e.:
>    function foo() {
>      var x = 42;
>      {
>        var y = 10;
>        print(x+y);
>      }
>      return x;
>    }
>
> Obviously it's useless, but it is valid.
 > ...
> /L 'Bad examples are bad!'

Herby


More information about the es-discuss mailing list