Henning Thielemann <iakd0@[EMAIL PROTECTED]
> wrote:
> I have noticed that a checked run-time error skips the FINALLY clause in
a
> TRY-FINALLY in cm3. Amusingly the occurence of an exception that is not
> handled _is_ a checked run-time error by itself. In "Programming with
> Style - Introduction into programming with Modula-3" the authors
mention
> this behaviour and rate it as unsuitable. This is also my judgement in
the
> first moment - so what are the reasons to go that way?
To get an authoritative answer to this question, we would have to ask
Farshad Nayeri or Bill Kalsow, I think, but I can give some possible
reasons:
1) Run-time errors must be handled immediately, as they may be caused
by serious resource problems, in which situation even the execution
of a FINALLY block might only make the situation worse and lead
to more breakage and exceptions.
2) Run-time errors constitute a class of exceptions of their own which
must be handled explicitly.
3) The compiler warns about uncaught exceptions, so you can avoid
those programming errors (like other incomplete case distinctions).
And you can always add an ELSE clause, which will not handle
any run-time error, but catch the (user-defined) forgotten
exception that would otherwise be converted into a run-time error.
Olaf
--
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
|| Olaf Wagner | wagner(at)luthien.in-berlin.de (priv.)|
|| Cranachstrasse 7 | wagner(at)elego.de (business) |
|| D-12157 Berlin | phone: +49 30 85 60 26 70 |
|| Germany / Deutschland | fax: +49 30 85 58 01 88 |
\/////////////////////////////////////////////////////////////////


|