JEP proposed to target JDK 11: 323: Local-Variable Syntax for Lambda Parameters
jbluettduncan at gmail.com
Fri Jan 26 14:02:52 UTC 2018
I admit I'm a bit lost. I struggle to see how the following:
Function<Integer, Integer> function = (@Nullable x) -> (x == null) ? 0 : x
would be any better than:
Function<@Nullable Integer, @Nonnull Integer> function = x -> (x == null) ?
0 : x + 1;
or even just the following (if we make the reasonable assumption that
everything is non-null by default):
Function<@Nullable Integer, Integer> function = x -> (x == null) ? 0 : x +
Is there something I'm missing here? :)
On 26 January 2018 at 13:54, Andrew Dinn <adinn at redhat.com> wrote:
> On 26/01/18 13:47, Jonathan Bluett-Duncan wrote:
> > Hmm, is that not what variables like the following are for?
> > Function<@Nullable Integer, @Nonnull Integer> function = x -> (x ==
> null) ?
> > 0 : x + 1;
> My, how old-school having to actually inscribe in your program the
> semantics you intend for your code, plain for all to see and comprehend,
> when a super-smart (TM) compiler can simply invent them for you out of
> thin^H^H^H^H abundant white space.
> Look how many characters it requires to make your intentions clear. Not
> to mention the amount of thought required in order to be able to express
> them explicitly.
> This is progress and it cannot be resisted.
> Andrew Dinn
> Senior Principal Software Engineer
> Red Hat UK Ltd
> Registered in England and Wales under Company Registration No. 03798903
> Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the jdk-dev