Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Andreas Leitgeb Newsgroups: comp.lang.java.programmer Subject: underscore as keyword in Java 9 Date: Sat, 23 Sep 2017 11:58:35 -0000 (UTC) Organization: A noiseless patient Spider Lines: 22 Message-ID: Reply-To: avl@logic.at Injection-Date: Sat, 23 Sep 2017 11:58:35 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="234a3602e85db1ee1ead9fc6249d05ed"; logging-data="20703"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19QZQG1UxOtqMpY+OpHyx0c" User-Agent: slrn/1.0.2 (Linux) Cancel-Lock: sha1:HmhQ04izDG3v2uLg2f0Im95//Y8= Xref: csiph.com comp.lang.java.programmer:37452 When googling for underscore keyword I found a mail by Brian Goetz, where he hinted for a future use of the "_" keyword: http://mail.openjdk.java.net/pipermail/lambda-dev/2013-July/010670.html " However, things it might be used for include things like "I don't want " to give this variable a name" (such as catch parameters that are never " used.) Now, some people might already have used that identifier in exactly such circumstances, namely for variable names that need to be there syntactically, but are not intended to be used. It strikes me odd, that Java would first forbid them generally, only to later essentially encourage that particular use again. Maybe, if that was the intention already 4 years ago, they should only have made uses of "_" as values (lvalue or rvalue) illegal. Comments? Maybe there have risen newer intentions for different uses in the meantime?