What happened to JEP-302 (Lambda Leftovers) ?
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Apr 29 17:30:15 UTC 2022
Hi Tobias,
your question is on point.
The JEP is consists of two main features:
* tweak the shadowing rules for lambda parameters, so that lambda
parameter can shadow local variable from enclosing scopes
* use `_` as an unspecified lambda parameter name
While we have developed viable prototypes for both [1], we started to
feel that the scope of JEP 302 was too narrow. That is, that JEP focuses
mainly on enhancing usability of lambda expression, but some of the
proposed solutions would be, in fact, be applicable in other contexts as
well. For instance, using `_` as an unspecified name could be useful in
exception parameter names, method parameter names, binding variables,
etc. [2]. Similarly, while improving shadowing for lambda parameters can
yield dividends (esp. in certain API such as Map::computeIfAbsent),
other language features, such as pattern matching, suffer from similar
problems (e.g. pattern variables can't shadow enclosing local variables).
For these reasons, we believe that this JEP no longer reflects the
entirety of our thinking on these matters. As such, we propose that the
JEP should be withdrawn. Of course that doesn't mean that some of the
issues mentioned in the JEP will not be addressed. In due course they
will, but with a more holistic perspective: after all, a lot has changed
in the Java language since JEP 302 first appeared.
Cheers
Maurizio
[1] -
http://mail.openjdk.java.net/pipermail/amber-dev/2017-March/000049.html
[2] -
https://mail.openjdk.java.net/pipermail/amber-dev/2017-June/001370.html
On 29/04/2022 14:19, Tobias Gierke wrote:
> Hi,
>
> I always feel like it's going to get included in the next JDK release
> ... and yet it never happens :( Is there a specific reason for that,
> other than lack resources ?
>
> Thanks,
> Tobias
>
More information about the discuss
mailing list