4 ms·
Yes, it isn't lexical scoping, it's dynamic, but that is the same way as exception handlers are scoped currently.
by tomp 15y ago
Yes, it isn't lexical scoping, it's dynamic, but that is the same way as exception handlers are scoped currently.
- mjw 15y agoAre they though? in which language? I was under the impression that the traditional 'catch' block has the stack unwound for it back to a frame with the same lexical scope as the associated 'try'...
- tomp 15y agoDynamic bindings are characterized by being bound not by the nearest preceding code at compile-time, but by the nearest preceding code at run-time. Therefore, the way I understand it, the important bit is not the relationship between a try and a catch, but between the throw and the catch. You could imagine throw as a call of the function last_catch(Exception e), which is dynamically bound by one of the "parent" functions (functions below on the stack).