return-from-lambda viewed as dangerous, good alternatives
Neal Gafter
neal at gafter.com
Thu Jan 7 15:36:36 PST 2010
On Thu, Jan 7, 2010 at 3:06 PM, Jonathan Gibbons
<Jonathan.Gibbons at sun.com>wrote:
> I don't deny the importance of control abstraction, and I don't deny that
> closures can provide the implementation mechanism; I was simply noting that
> we don't need identical syntax for them, or even (for users) to think of
> them as the same concept. So, in a closure, return means return from the
> enclosing closure; in a control abstraction, return means return from the
> enclosing method, and it is merely an implementation detail for compiler
> engineers that control abstraction might get desugared into a closure, with
> any return statements being converted into an appropriate non-local return.
>
I'm not sure I understand what you mean by "control abstraction" here. The
BGGA control invocation statement form can only express a limited subset of
the use cases for control abstraction (e.g., only one controlled block),
which is why there's an underlying transparent lambda form. What do you
have in mind for "control abstraction" that is not a closure?
More information about the lambda-dev
mailing list