jastrachan | 30 Mar 16:58 2005
Picon

Re: having second thoughts about :: versus => / ->

On 24 Mar 2005, at 11:48, Wang Bin wrote:
> Hi, Every body,
>     I don'y know why we should change closure from {x| println x} to { 
> x -> println }. I really like form { x| ...} very much in despite of 
> it conflicts with xor.

Because as soon as we allow default arguments on closures which take 
expressions (like regular parameter lists do in method declarations in 
groovy) we have ambiguity with binary or.

// is this a binary or, or a return of 'b'
{y | b}

// where does the parameter list end
{y = a | b | c}

so we figured, its time to choose another token thats not commonly used 
in Java to avoid this ambiguity. (We tried all kinds of rules to get 
around making this change all of which seemed smelly in some sense or 
other).

James
-------
http://radio.weblogs.com/0112098/


Gmane