Hi guys
I'm trying to explain the following sentence (I wrote long time ago) and now I'm stuck "escaping
blocks jump to their home contexts but do not unwind the stack after
this point" especially I'm not clear anymore on the unwind the stack. Stef
|
On 22 juil. 2013, at 22:58, Stéphane Ducasse wrote:
Maybe you meant that escaping blocks unwind the stack *up to* their home context.
|
In reply to this post by Stéphane Ducasse
On Mon, Jul 22, 2013 at 1:58 PM, Stéphane Ducasse <[hidden email]> wrote:
Seems wrong to me. ^-returns in blocks return to the sender of the home context.
The stack is unwound either by the VM executing the ^-return or by MethodCOntext>>#return:, sent from #aboutToReturn:to: if the ^-return found an intervening unwind context. (The VM sends aboutToReturn:to:).
HTH Eliot
best, Eliot
|
On Jul 23, 2013, at 12:25 AM, Eliot Miranda <[hidden email]> wrote:
Thanks what is a intervening unwind context?
|
2013/7/23 Stéphane Ducasse <[hidden email]>
I'm not sure I understood the question but:
Unwind a context means when you return from a context to an outer one far in the stack you need to check for unwind context (= context with 'ensure:'), and execute the unwind block (= ensure: argument). For ex: context 1 context 2 context 3 (marked with primitive as unwind context) context 4 context 5 Non local return to context 1 Here the non local return in context 5 goes back to context 1 skipping the rest of the execution of the context 2 - 3 - 4. While going back to context 1 it checks every context (2, 3, 4), detects context 3 as unwindcontext and executes the unwind block of context 3 before continuing the execution in context 1.
|
Got it.
Yes I forgot and I guess that we wrote that somehow in the exception chapter. Stef
|
Free forum by Nabble | Edit this page |