New
Rémi Forax
forax at univ-mlv.fr
Mon Mar 29 02:50:31 PDT 2010
Le 29/03/2010 11:36, Howard Lovatt a écrit :
> A number of people have commented about using new for lambdas, there are at
> least 4 good reasons to use new:
>
> 1. It is what the rest of Java uses, e.g.:
>
> List<Integer> list = new ArrayList<Integer>();
> #<int()> lambda = new #<int()>(42);
>
String s ="foo";
> 2. It is compatible with the diamond operator from Coin (assuming<> are
> used), e.g.:
>
> List<Integer> list = new ArrayList<>();
> #<int()> lambda = new #<>(42);
>
The diamond operator doesn't work with primitive types.
[...]
Rémi
More information about the lambda-dev
mailing list