Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.


16.5 Stack and Exceptions

The concept `recent' used earlier is connected with the stack (see 13.2 Raising an Exception). A recent procedure is one which is on the stack, the most recent being the current procedure. So, when Raise is called it looks through the stack until it finds a procedure with an exception handler. That handler will then be used, and all procedures before the selected one on the stack are taken off the stack.

Therefore, a recursive function with an exception handler can use Raise in the handler to call the handler in the previous (recursive) call of the function. So anything that has been recursively allocated can be `recursively' deallocated by exception handlers. This is a very powerful and important feature of exception handlers.


Go to the Next or Previous section, the Detailed Contents, or the Amiga E Encyclopedia.