comp.lang.ada
 help / color / mirror / Atom feed
From: "James Giles" <jamesgiles@worldnet.att.net>
Subject: Re: F9X twister & ADA (was: n-dim'l vectors)
Date: 2000/04/11
Date: 2000-04-11T00:00:00+00:00	[thread overview]
Message-ID: <5jJI4.297$PV.9915@bgtnsc06-news.ops.worldnet.att.net> (raw)
In-Reply-To: 38F2C1DC.5538F9F0@research.canon.com.au


Geoff Bull wrote in message <38F2C1DC.5538F9F0@research.canon.com.au>...
>James Giles wrote:
>> Not that Ada is inherently superior.  They
>> did a lot of things badly too (their exception handling, for example).
>
>What don't you like about Ada exceptions?

They may have fixed it by now (I haven't used Ada since the '80s).
But, I haven't heard anything to suggest that exception handling
was changed in the more recent standards.

In Ada you can't tell what exceptions a procedure might generate
from it's use or declaration.  So your handler for a given block
can't assume that the condition that arises is from the local
code - if the block contains a procedure call.  Exceptions arising
from within procedures should be easily distinguishable from locally
generated exceptions.

A given exception might be actually handled by a remote ancestor
in the call tree: which couldn't possibly have any specific knowledge
about how to recover from an error so remote.  At some point you
should just turn such an exception into a non-specific "halt program"
signal.  Better: each procedure in the call tree should either explicitly handle
exceptions or *explicitly* pass them to its (immediate) caller.  If neither,
the program should halt right there.  Mystically skipping over several
levels of the call tree is messy.

Exception handling can be used as a form of Zahn's construct for
*normal* flow control (not involving any error conditions at all).
It is not very good programming practice, perhaps, but it can
easily be done.

If you intend to recover from them, handling hardware traps and faults
(like float exceptions, or  memory range errors) requires finer control
than block-level structures.  A single expression may have several
operations that might cause such faults.  If your exception handler
is at the block-level, it needs to have an elaborate bit of code just
to discover *which* possible cause actually triggered the exception.
(I don't know an easy solution for this.  But finer control is desirable
for such cases.)

Ada exception handling does too many things in one feature.  Multilevel
message passing (like C's setjump/longjump), one level error reporting
(like Fortran's alternate return), local error recovery, and ordinary
Zahn's-construct flow control. It would be better to have explicit
control over each of these different uses.

--
J. Giles






  reply	other threads:[~2000-04-11  0:00 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8cctts$ujr$1@nnrp1.deja.com>
     [not found] ` <38EA0440.1ECBC158@ncep.noaa.gov>
2000-04-06  0:00   ` F9X twister & ADA (was: n-dim'l vectors) bv
2000-04-06  0:00     ` Richard Maine
2000-04-07  0:00       ` Brian Rogoff
2000-04-08  0:00         ` Dick Hendrickson
2000-04-08  0:00           ` Richard Maine
2000-04-09  0:00             ` Gary Scott
2000-04-09  0:00               ` Richard Maine
2000-04-09  0:00           ` Geoff Bull
2000-04-09  0:00             ` Dick Hendrickson
2000-04-09  0:00               ` Robert Dewar
2000-04-09  0:00                 ` Gordon Sande
2000-04-09  0:00                   ` James Giles
2000-04-10  0:00                 ` tmoran
2000-04-15  0:00                 ` Aidan Skinner
2000-04-17  0:00                   ` Robert I. Eachus
2000-04-16  0:00                 ` Ken Garlington
2000-04-12  0:00               ` Robert I. Eachus
2000-04-10  0:00       ` bv
2000-04-10  0:00         ` James Van Buskirk
2000-04-11  0:00         ` James Giles
2000-04-11  0:00           ` Geoff Bull
2000-04-11  0:00             ` James Giles [this message]
2000-04-11  0:00               ` Larry Kilgallen
2000-04-11  0:00                 ` James Giles
2000-04-11  0:00                   ` Larry Kilgallen
2000-04-12  0:00                   ` Robert A Duff
2000-04-12  0:00               ` Geoff Bull
2000-04-12  0:00                 ` James Giles
2000-04-12  0:00                   ` Geoff Bull
2000-04-12  0:00                     ` James Giles
2000-04-12  0:00                       ` Geoff Bull
2000-04-12  0:00                         ` Marin D. Condic
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                           ` James Giles
2000-04-12  0:00                         ` James Giles
2000-04-13  0:00                           ` Geoff Bull
2000-04-13  0:00                             ` James Giles
2000-04-14  0:00                               ` Geoff Bull
2000-04-13  0:00                             ` Debugging (was: F9X twister & ADA) James Giles
2000-04-11  0:00           ` F9X twister & ADA (was: n-dim'l vectors) Dale Stanbrough
2000-04-11  0:00             ` James Giles
2000-04-12  0:00               ` Robert A Duff
2000-04-14  0:00           ` bv
2000-04-07  0:00     ` Paul van Delst
2000-04-10  0:00       ` bv
2000-04-07  0:00     ` Erik Edelmann
2000-04-07  0:00       ` Robert Dewar
2000-04-07  0:00         ` Erik Edelmann
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox