Re: try: execpt:/ try: finally: behavior

Mark S. Riggle (sasmsr@zinfande.unx.sas.com)
Tue, 21 Jun 1994 20:33:18 GMT

In article <9406211726.AA28146=guido@voorn.cwi.nl>, Guido.van.Rossum@cwi.nl writes:

|> Finally note that the source of your conclusion may be a different
|> model of how exceptions work. The raised exception is not "directed"
|> at the outer except clause -- it is simply an alternate return from
|> the function, which percolates through the stack until a matching
|> exception handler is found. When a finally clause is executed, the
|> pending exception is temporarily saved, and when the finally clause
|> completes normally the saved exception is re-raised.

The difference I see is in that stack scan. All exception handlers
between the current place and the matching exception handler should be
disabled before any intervening finally clauses are executed. Then
a exception raised in a finally clause needs to go past the currently
matching handler. If none exist, it is an error.

-- 
=========================================================
Mark Riggle                         | "Give me LAMBDA or
sasmsr@unx.sas.com                  |  give me death"
SAS Institute Inc.,                 |
SAS Campus Drive, Cary, NC, 27513   |  
(919) 677-8000                      |