[795] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: exception handling...

daemon@ATHENA.MIT.EDU (Thu Aug 31 19:07:46 1995 )

Date: Thu, 31 Aug 1995 18:56:25 -0400 (EDT)
From: James C Deikun <jcdst10+@pitt.edu>
To: 869683 Gillespie Brandon James <brandon@smithfield.declab.usu.edu>
Cc: coldstuff@MIT.EDU
In-Reply-To: <9508312224.AA04443@smithfield.declab.usu.edu>

On Thu, 31 Aug 1995, 869683 Gillespie Brandon James wrote:

> < This isn't an exception handler, it's a switch statement.
> No, it is both.  Yes, I'm aware of its similarity with a switch statement,
> but it is cleaner and more succinct than the current method, in conjunction
> with a switch, ala:


Hm, you seem to be missing my point.  Why do this:

> for obj in (list) {
>     catch { 
>         obj.query_test();
>     } handle ~locked {
>         sender().print("Object is locked.");
>     } handle others {
>         sender().print("Error: " + toliteral(error) + " encountered!");
>     } finally {
>         sender().print("Test is sucessful for: " + obj.name());
>         valid = valid + [obj];
>     }
> }

with a test predicate that throws exceptions, rather than a switch 
statement with a predicate returning values (or even an 
exception-throwing one wrapped up as a critical expression)?

> Like I said, its mainly a small change.  However, my goal is to get it 
> to a 3-stage handler, rather than the 2-stage one it is at now.  I.e.
> currently you have "error->oops, do this", Richelieu brought up that it
> would be nice to do 3 stages, ala "error, try this, otherwise this".  I'm
> just having a hard time finding a good way to do it.

I'm not sure what you mean by this.

James "attack the stack" Deikun