Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ncar!oddjob!nucsrl!morrison From: morrison@eecs.nwu.edu (Vance Morrison) Newsgroups: comp.lang.c++ Subject: Re: Proposal for Exceptions for C++ Message-ID: <8180007@eecs.nwu.edu> Date: 30 Mar 88 16:09:25 GMT References: <8180006@eecs.nwu.edu> Organization: Northwestern U, Evanston IL, USA Lines: 38 This is in responce to the comments I have seen so far on my proposal for exception handling for C++. First may I say that I am glad to see such a good responce so soon. Second, I really must apologize for the incompleteness of my proposal. I realize that I really did not explain the semantics of the stack unwinding and other issues well (if at all). Instead I am relying on the interactive nature of the net to fill in the gaps as necessary. Here are some things that need clarification MEANING OF RAISING AN EXCEPTION First let me clarify what happens when an exception is raised. In my model a search goes on for the most closely nested 'catch' statement that protects the code in which the exception was raised.t The 'catch' clause is given control and unless the clase is exited (by using a 'return' 'goto' 'break' or 'resume' statement), the exception is implictly reraised. This causes a search for the next layer of 'catch'ing until either a catch clause is exited or the last chance handler is executed. MEANING OF RESUME There is some confusion about the meaning of 'resume' resume returns control to after the catch clause, NOT TO THE POINT WHERE THE EXCEPTION OCCURED. It is IDENTICAL to a goto statement that jumps right after the 'catch' clause. That is i = j/k; catch { printf("error\n"); resume; } printf("done\n"); Is equivalent to i = j/k; catch { printf("error\n"); goto out; } out: printf("done\n");