On 09/30/2012 01:04 AM, bioinfornatics wrote:
hi,


int[] list = [ 0, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9 ];

why this do not works ?
list.reduce!( (a,b) => a + b )( 0 ); // sum all elements

but by this way that is ok:
reduce!( (a,b) => a + b )( 0, list ); // sum all elements




Because of the parameter order.

0.reduce!((a,b)=>a+b)(list); // works

Reply via email to