JEP 213: Milling Project Coin

Benji Weber javac at
Sat Oct 18 08:01:18 UTC 2014

Is it worth reconsidering? Underscore as a variable name has become
significantly more useful since the release of 8. For example

We can now do partial application.

  Function<Integer, Integer> plusFive = Partially.apply(Math::addExact, _,
  int seven = plusFive.apply(2);

We can now do pattern matching.

    .when(arg("--help", _), arg -> this.printHelp(arg.value()))
    .when(arg("--lang", _), arg -> this.setLanguage(arg.value()))

Of course we could use a different variable name other than underscore to
represent a wildcard, but underscore is already widely understood as a
placeholder in this context, due to its use in Scala, Haskell and others.

Removing _ means it will only be useful for what the language developers
have been able to think of/implement, rather than what any library
developers can implement, and restricted to the language release schedule.


On 17 October 2014 20:36, Brian Goetz <brian.goetz at> wrote:

> This is merely a follow-through on a decision that was made as part of
> JSR-335, Lambda Expressions for the Java Language.  In 8, warnings were
> issued when such identifiers were used, that say "this will go away in 9."
> (Try it with an 8 build, you'll see.)  This is merely the follow-through to
> that decision (since we couldn't do it all in one go in 8.)
> On 10/15/2014 9:05 PM, Rob Leland wrote:
>> Is there a JDK issue filed somewhere that discusses #4 Remove underscore
>> .... Since its sure to draw some push back.
>> All other issues have such a reference.
>> On Oct 15, 2014 8:56 PM, <mark.reinhold at
>> <mailto:mark.reinhold at>> wrote:
>>     New JEP Candidate:
>>     - Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the compiler-dev mailing list