Checked exceptions within Block<T>
Neal Gafter
neal at gafter.com
Wed Jan 16 00:02:01 PST 2013
On Tue, Jan 15, 2013 at 9:41 PM, Brian Goetz <brian.goetz at oracle.com> wrote:
> Dynamic detection is used, for example, to ensure that someone doesn't
> [...] call it after the variable to be mutated has gone out of scope.
>
You can't (syntactically) name a variable that is out of scope, so there is
no way to mutate it if it is out of scope. My point is that variable scope
is a lexical concept, and lifetime is a dynamic concept. The variable
"comes in and out of scope" every time a lambda in the scope of the
variable is executed - and then it is in scope on some threads but not in
others. It is a category error to suggest any dynamic checking would be
helpful.
On the other hand the scope and lifetime of control constructs
(specifically the control targets associated with break, continue, and
return) do have some association.
More information about the lambda-dev
mailing list