Path: news.cs.au.dk!not-for-mail From: "Jorgen Lindskov Knudsen" Newsgroups: comp.lang.beta Subject: Re: exceptions: (atle // confused (# again #) atle) Date: Tue, 20 Jun 2000 00:04:13 +0200 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 65 Message-ID: <8im5cu$90ug$1@xinwen.cs.au.dk> References: <20000619173848.8485.qmail@noatun.mjolner.dk> <8im02p$8s5j$1@xinwen.cs.au.dk> <394EB616.EB35CCE1@skynet.be> NNTP-Posting-Host: isdn-002.cs.au.dk X-Trace: xinwen.cs.au.dk 961452254 295888 255.255.255.255 (19 Jun 2000 22:04:14 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 19 Jun 2000 22:04:14 GMT X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 Xref: news.cs.au.dk comp.lang.beta:12449 Atle wrote in message <394EB616.EB35CCE1@skynet.be>... >Jorgen Lindskov Knudsen wrote: >> >> The third model is 'static exception handling': This is the model used in >> BETA. Raising exception is similar to the dymnamic model. The difference >> is, that is is _not_ the runtime system, that makes a traversal of the >> runtime stack to find some appropriate exception handler. However, the >> static definition of the exception implied the definition of the handler, >> being associated with the exception, implying that the handler is statically >> specified in the program text. The virtual mechanism of the language is >> used to make it possible to associate different handlers to an exception. >Could you give me a reference to some pseudocode that just traces the program execution? I must admit, that I do not understand, what you mean by 'traces the program execution' here. >I will read the chp on static exceptions again, though :-) >> >> Which of these model, one prefer is partly a matter of taste, and background >I intuitively felt that this third model was the 'right' one, at least when I read about it the first time. > >I have a Y/N question that would help me to get answered: > >Is all program flow explicit in the code dealing with the exception (Y/N)? >(Meaning: Does it 'work like' checking return values? No - that's model one in my original posting. The BETA model works as follows. Let us assume, that we are having the following routine: foo: (# ex:< exception(# ... #) do ...some code of the routine ...then an error occurs ex; (* this is the way to raise a static exception in BETA *) ...possibly some more code #); If we then later executes this foo routine, we can associate a handler with the 'ex' exception by: ... foo(# ex:: (# ...here insert some exception handling code #) #); ... Now, if we want the exception handling code to state, that it have handled the exception, the exception handling code just have to specify 'true->continue', then the execution will continue at the '...possibly some more code' section of 'foo'. If not, the entire program will terminate (unless a non-local leave is specified in the exception handling code). I hope this helps. --- jlk