liittle question about reduce

bioinfornatics bioinfornatics at fedoraproject.org
Sat Sep 29 16:04:19 PDT 2012


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




More information about the Digitalmars-d-learn mailing list