Transparancy
Joshua Bloch
jjb at google.com
Wed Jul 7 17:48:29 PDT 2010
Reinier,
On Wed, Jul 7, 2010 at 5:33 PM, Reinier Zwitserloot <reinier at zwitserloot.com
> 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.
Josh
More information about the lambda-dev
mailing list