[790] in Coldmud discussion meeting

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

exception handling...

daemon@ATHENA.MIT.EDU (Thu Aug 31 03:27:22 1995 )

Date: Thu, 31 Aug 1995 01:25:08 -0600
From: 869683 Gillespie Brandon James <brandon@smithfield.declab.usu.edu>
To: coldstuff@MIT.EDU

I'm mulling over the reconstruction of exception handling (catch) to be
slightly different.  The best way to explain this is with an example:

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

Basically, each handle ~error line is for whichever error, where the
handle others is for all others.  If it does not exist, the error
is propogated normally.

The otherwise clause we are still hung up on, but Jeff Bellegarde and
I feel it is better than:

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

But we are still undecided.

What does everybody else feel about this?

-Brandon