hg: lambda/lambda/jdk: reorder Reducer type variables to match invocation order. remove ? super from reducer base value in APIs.

Rémi Forax forax at univ-mlv.fr
Fri Sep 16 01:10:50 PDT 2011


On 09/16/2011 01:12 AM, David Holmes wrote:
> I may be mis-reading this but didn't you (Remi) ask for parameters of 
> the method to be swapped not the type parameters of the interface? Now 
> they may be consistent but the order seems wrong to me.

yes, you're right,
I've ask the opposite but I'm not sure it's better.
By example,
   int sum = 0;
   for(String s: list) {
       sum = sum + s.length();
   }

is translated to:
   int sum = list.reduce(0, sum, s -> sum + s.length());

as you can see the order of the parameters follow the order of the 
expression.

>
> David

Rémi



More information about the lambda-dev mailing list