[796] 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 (Fri Sep 1 12:49:00 1995 )

From: Chuck Adams <cadams@weather.Brockport.EDU>
To: brandon@smithfield.declab.usu.edu (869683 Gillespie Brandon James)
Date: Fri, 1 Sep 1995 10:44:26 -0600 (MDT)
Cc: coldstuff@MIT.EDU
In-Reply-To: <9508310725.AA04032@smithfield.declab.usu.edu> from "869683 Gillespie Brandon James" at Aug 31, 95 01:25:08 am

869683 Gillespie Brandon James drew these hieroglyphs:
> 
> 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];
>     }
> }

> What does everybody else feel about this?

hmm... puts the successful case at the bottom instead of the top --
one expects the successful case most of the time (that is, success is
the typical case), and doesn't want to skip over a bunch of border
cases to reach the code for the typical case.

Gets a minus for readability IMHO.

Chuck