Another approach to lambdas

S

Sebastian

Am 18.07.2013 07:36, schrieb Robert Klemme:
Yes. I specifically meant the syntax. Java 8 lambda syntax is reasonably
OK, but I wish they would have entirely dispensed with the need to
explicitly refer to the single method in a functional interface.

Compare
sumList.apply(map(x -> sumList.apply(x), matrix)); (*)
to
sumList(map(x -> sumList(x), matrix)); (**)
where
sumList is something like
Function<List<Integer>, Integer> sumList = x -> foldr((a,b)->a+b, 0, x);

(*) is actual Java 8 syntax, but I wish it were (**). I even guess that
would have been possible with a bit of compiler magic.

-- Sebastian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top