Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #24752

Re: Another approach to lambdas

From Sebastian <news@seyweiler.dyndns.org>
Newsgroups comp.lang.java.programmer
Subject Re: Another approach to lambdas
Date 2013-07-18 08:23 +0200
Organization albasani.net
Message-ID <ks81l2$tn0$1@news.albasani.net> (permalink)
References <nXmFt.10$2C2.1@fx04.iad> <ks739q$c9j$1@news.albasani.net> <b4pd7gF43taU1@mid.individual.net>

Show all headers | View raw


Am 18.07.2013 07:36, schrieb Robert Klemme:
> On 17.07.2013 23:45, Sebastian wrote:
>> Am 17.07.2013 04:02, schrieb Arved Sandstrom:
>>> http://www.infoq.com/news/2013/07/el3
>>
>> I like the EL syntax: ((x,y) -> x+y)(4, 5)
>>
>> This reads like a real functional expression, no clutter with ".apply()"
>> etc. A pity this wasn't possible in Java.
>
> It will be soon.
>
> http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html
>
> Cheers
>
> robert
>
>
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

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Another approach to lambdas Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-07-16 23:02 -0300
  Re: Another approach to lambdas Jan Burse <janburse@fastmail.fm> - 2013-07-17 08:46 +0200
  Re: Another approach to lambdas Sebastian <news@seyweiler.dyndns.org> - 2013-07-17 23:45 +0200
    Re: Another approach to lambdas Robert Klemme <shortcutter@googlemail.com> - 2013-07-18 07:36 +0200
      Re: Another approach to lambdas Sebastian <news@seyweiler.dyndns.org> - 2013-07-18 08:23 +0200

csiph-web