I should elaborate on the reason for the unwind loop implementation described in my previous email and repeated below:
Anthony Hannan ajhannan@yahoo.com wrote:
In senders of #terminateTo:, like #return: and #restart, unwinding is done while terminating. They find the next ensure:/ifCurtailed: (unwind) sender, terminate to it, execute its unwind block, then repeat until the target home context is found.
It is important to terminate (pop contexts) to the ensure:/ifCurtail: context before executing its unwind block so the unwind block is executed within the correct dynamic scope (ie. exception handlers). If the unwind block is executed before terminating (or even worse, in another process) handlers created during the execution of the original block will still be there and catch errors raised by the unwind block. The intension is to unwind the stack first to the point of the ensure:/ifCurtail: then execute its unwind block. This is why #return: terminates a single chunk at a time instead of all at once in the end.
Cheers, Anthony
__________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/
squeak-dev@lists.squeakfoundation.org