int19h at gmail.com
Wed Jul 7 11:49:00 PDT 2010
On Wed, Jul 7, 2010 at 11:26 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> The quibbling over the semantics of return are a
> reflection of trying to force lambdas to either be exactly like inner classes
> or something completely new. The reality is that they are somewhere in the
> middle. Using "return" now complicates our ability to provide nonlocal
> control flow in the future.
I don't see why it would complicate the ability to provide non-local
returns in general. It would certainly complicate the ability to do so
for lambdas which retain the rest of the presented syntax, but this
isn't a requirement for future development.
In general, the ability of the lambda to return (and otherwise
transfer control) nonlocally should be captured in its type, anyway,
and giving a different top-level syntax for that new lambda type would
allow the semantics of return in the lambda to be redefined
specifically for that syntax later on, if desired.
More information about the lambda-dev