Block lambda is cool, its syntax isn't

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Jan 12 13:38:27 PST 2012


On Jan 12, 2012, at 1:26 PM, Thaddee Tyl wrote:

> I have heard many fellow programmers say that, while block lambdas
> would be welcome, Ruby's |a, b| syntax is ugly.
> I thought I was the only one feeling this way, but since I am not, I
> would like to ask why the parentheses cannot be used there.
> 
>    { (a, b) a + b }
> 
> cannot conflict with any existing program; at least I don't see how it can.

but it is ambiguous with  other currently valid statement blocks such as:

   { (a, b) + b}

or

  { (a,b)
     a+b
  }

Allen


More information about the es-discuss mailing list