Joshua Bloch jjb at
Wed Jul 7 17:48:29 PDT 2010


On Wed, Jul 7, 2010 at 5:33 PM, Reinier Zwitserloot <reinier at
> wrote:

> .
> To preserve (future) transparency, yield is used instead of return.

I believe this is an abuse of the word "transparency."  There's nothing
transparent about making the "return" keyword do double duty to mean "long
return."  It's a new concept, and if and when it is to be supported in Java,
it deserves a new keyword.

> Okay. It
> has a secondary benefit, even, in that folks looking at java code
> definitely
> won't confuse an 'inner' return with an 'outer' one, as inner returns are
> now called 'yield'.

This makes little sense to me.  I don't think anyone would confuse a return
from within a lambda with a "naked return."  People don't have that problem
with nested classes today.

> However, if future transparency is the goal...

When you say "future transparency," I believe that what you mean is
"allowing lambdas to be used to emulate control constructs in the future."
 I think you should call it that.


More information about the lambda-dev mailing list