comp.lang.ada
 help / color / mirror / Atom feed
* Exceptions
@ 1989-06-23 21:57 howell
  0 siblings, 0 replies; 78+ messages in thread
From: howell @ 1989-06-23 21:57 UTC (permalink / raw)


I while back, I posted the following request to the net; attached are
the replies I recieved.  Thanks to those that replied!  I'm hoping that this
posting might stimulate more discussion on exception-handling issues
(e.g., CLU and "Exceptional C"s language support for denoting potential
exceptions from a unit, or paramterized exceptions...).
Thanks again,

    Chuck Howell
    MITRE, Mail Stop Z-645
    7525 Colshire Drive
    McLean, VA 22102-3481
    howell@community-chest.mitre.org

--------
From: mcvax!ukc!dcl-cs!aber-cs!pcg@uunet.uu.net  (Piercarlo Grandi)
Subject: Exception handling models

In article <8905021917.AA06033@starbase> howell@STARBASE.MITRE.ORG (Chuck Howell) writes:
    I'm interested in alternative exception handling models (e.g., Bertrand
    Myer's arguments on "disciplined exceptions" in _Object-oriented
    Software Construction_) and various idioms & conventions for use with
    existing Ada exception handling facilities.

I have long held that exception handling does not exist; an exception is
always the result of a missing case in some part of a program, i.e. the
program not computing a total function wrt its input data domain.

Exception "handling" is just adding in the appropriate places calls to
procedures to define the missing cases; such procedures whould be
dynamically scoped, so that they can be redefined dynamically.

In other words: "raise" should be replaced by a call to a dynamically
scoped procedure; dynmically scoped procedures should be added to the
language (a trivial exercise).

The issue of non local control transfer, which in the present exception
handling facility is wrongly and inextricably tied to exception handling,
should be provided as an orthogonal mechanism, as not all exception
"handlers" want to terminate with a non local goto, and not all uses of non
local gotos are in exception handlers.

I have posted a few months ago in comp.lang.c++ a C++ class that implements,
using constructors and destructors, dynamically scoped procedures as
exception handlers. It cannot be done as easily in Ada, without changing
the language a bit.
-- 
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk
----------------------------------------------------------

Return-Path: <tom%prg.oxford.ac.uk@NSFNET-RELAY.AC.UK>
Date:    Mon, 12 Jun 89 12:23:23 bst
From: Tom Thomson <tom%prg.oxford.ac.uk@NSFNET-RELAY.AC.UK>
To: howell%starbase.mitre.org@NSFNET-RELAY.AC.UK
Subject: Exception Handling Models

Two aspects that I care about:-
i) have to have containment, so that I can correct the error locally (inside 
   abstraction where it is detected) and avoid passing the exception to my
   user; but have to be able to pass exceptions on where appropriate. 
ii) separate the tasks of providing diagnostic information (eg trend information
    for preventative maintenance/component replacement) from those concerned
    with containment and recovery (eg correcting a single bit failure in a store
    with hamming codes, as opposed to logging the occurrence); the latter can do
    without being cluttered up with the former, and the former may need to be
    switchable independently of the latter.
 
At a slightly more aspect level of modelling, I believe strongly in in-line
exception handling. However this requires a language with a really good type
system (so that the values arising from exceptions can be typed) with much
type checking at run time, including the ability for code to discriminate on
the type of the data it's operating on. There was some work on this in the
Alvey Flagship project - - ICL & IC put exception values into the functional
language HOPE+ but it was never really taken very far or exploited much.
-----------------------------------------------------------
Return-Path: <emery@aries.mitre.org>
Date: Sun, 7 May 89 19:39:17 EDT
From: emery@aries.mitre.org (David Emery)
To: howell@starbase.mitre.org
Subject: Re:  exception models
Cc: emery@aries.mitre.org

i've often wished for exceptions with parameters (and exceptions AS parameters,
but that's another story)).  The basic model would probably not 'hurt' the
language, but would trash implementations.  
	here's some syntax ideas:
		raise an_exception(param => value);

		when an_exception =>
			if an_exception.param = value then ...

declaration syntax is a bit messier...
		an_exception : exception (param : its_type);

				dave

-------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 78+ messages in thread
* Exceptions
@ 1991-03-06 17:24 David Erickson
  1991-03-06 21:21 ` Exceptions Jerry Callen
  0 siblings, 1 reply; 78+ messages in thread
From: David Erickson @ 1991-03-06 17:24 UTC (permalink / raw)


I have a few questions related to implementation of exceptions in Ada:

Can I assume that any block with an exception handler will require an
activation record at run-time (as will blocks with declarations, procedures,
functions and packages)?

Exception handling appears to be inherently inefficient, since the entire
dynamic chain may have to be searched, checking each activation for an
appropriate handler (including activations which have no handler). Are
there any optimizations which are normally used to improve this search
process?

Since exception declarations obey static scoping rules, but the search
for exception handlers follows dynamic links, an exception can go out of
and back into scope (see Barnes pg. 181 for an example).  How are names
resolved in such a way that two exceptions with the same name, declared
in different parts of the program, do not get confused? 

I would also appreciate any references to articles which address
Ada implementation issues.

-Dave Erickson

^ permalink raw reply	[flat|nested] 78+ messages in thread
* Exceptions
@ 2007-12-06 15:00 shaunpatterson
  2007-12-06 21:24 ` Exceptions tmoran
                   ` (4 more replies)
  0 siblings, 5 replies; 78+ messages in thread
From: shaunpatterson @ 2007-12-06 15:00 UTC (permalink / raw)


Is there any way to force programmers to catch exception that
your function throws? Something like Java forcing coders to
put try/catch blocks


Thanks
--
Shaun



^ permalink raw reply	[flat|nested] 78+ messages in thread

end of thread, other threads:[~2007-12-15  5:29 UTC | newest]

Thread overview: 78+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-06-23 21:57 Exceptions howell
  -- strict thread matches above, loose matches on Subject: below --
1991-03-06 17:24 Exceptions David Erickson
1991-03-06 21:21 ` Exceptions Jerry Callen
2007-12-06 15:00 Exceptions shaunpatterson
2007-12-06 21:24 ` Exceptions tmoran
2007-12-07  8:54   ` Exceptions Dmitry A. Kazakov
2007-12-07 10:21     ` Exceptions Georg Bauhaus
2007-12-07 15:11       ` Exceptions shaunpatterson
2007-12-07 16:08         ` Exceptions Gautier
2007-12-07 18:56         ` Exceptions Simon Wright
2007-12-08 10:04         ` Exceptions Stephen Leake
2007-12-08  3:30     ` Exceptions Randy Brukardt
2007-12-08 12:26       ` Exceptions Peter C. Chapin
2007-12-08 14:01         ` Exceptions Dmitry A. Kazakov
2007-12-08 18:01           ` Exceptions Peter C. Chapin
2007-12-09 10:06             ` Exceptions Dmitry A. Kazakov
2007-12-09 12:40               ` Exceptions Peter C. Chapin
2007-12-09 14:31                 ` Exceptions Dmitry A. Kazakov
2007-12-09 16:38                   ` Exceptions Peter C. Chapin
2007-12-10  8:31                     ` Exceptions Dmitry A. Kazakov
2007-12-09 21:56                 ` Exceptions Robert A Duff
2007-12-09 10:24             ` Exceptions Stephen Leake
2007-12-09 12:46               ` Exceptions Peter C. Chapin
2007-12-09 21:39   ` Exceptions Robert A Duff
2007-12-09 22:13     ` Exceptions Georg Bauhaus
2007-12-11  8:07       ` Exceptions Stephen Leake
2007-12-11 20:28         ` Exceptions Simon Wright
2007-12-12 22:10         ` Exceptions Maciej Sobczak
2007-12-13 13:40           ` Exceptions Robert A Duff
2007-12-13 14:00             ` Exceptions Maciej Sobczak
2007-12-13 14:44               ` Exceptions Robert A Duff
2007-12-14  0:46                 ` Exceptions Ray Blaak
2007-12-14  2:36                   ` Exceptions Randy Brukardt
2007-12-14  6:21                     ` Exceptions Ray Blaak
2007-12-14 12:40                       ` Exceptions Georg Bauhaus
2007-12-14 17:29                   ` Exceptions Robert A Duff
2007-12-14 19:32                     ` Exceptions Dmitry A. Kazakov
2007-12-15  5:29                     ` Exceptions Ray Blaak
2007-12-13 19:29               ` Exceptions Randy Brukardt
2007-12-12 19:18     ` Exceptions Martin Krischik
2007-12-13 13:27       ` Exceptions Robert A Duff
2007-12-13 23:25       ` Exceptions Ray Blaak
2007-12-06 21:25 ` Exceptions Gautier
2007-12-07  4:29 ` Exceptions anon
2007-12-07 16:55 ` Exceptions Adam Beneschan
2007-12-07 18:59   ` Exceptions Simon Wright
2007-12-08  0:38     ` Exceptions Adam Beneschan
2007-12-09 21:45     ` Exceptions Robert A Duff
2007-12-09 22:40       ` Exceptions Georg Bauhaus
2007-12-10  8:22         ` Exceptions Dmitry A. Kazakov
2007-12-10  9:20           ` Exceptions Georg Bauhaus
2007-12-10  9:30             ` Exceptions Georg Bauhaus
2007-12-10 10:56             ` Exceptions Dmitry A. Kazakov
2007-12-11  2:18               ` Exceptions Randy Brukardt
2007-12-11  8:19               ` Exceptions Georg Bauhaus
2007-12-11 11:55                 ` Exceptions Dmitry A. Kazakov
2007-12-11 16:13                   ` Exceptions Georg Bauhaus
2007-12-12 11:18                     ` Exceptions Dmitry A. Kazakov
2007-12-10 12:09           ` Exceptions Niklas Holsti
2007-12-10 13:08             ` Exceptions Dmitry A. Kazakov
2007-12-10 20:02               ` Exceptions Niklas Holsti
2007-12-11 12:31                 ` Exceptions Dmitry A. Kazakov
2007-12-11 13:21                   ` Exceptions Niklas Holsti
2007-12-12  0:01                     ` Exceptions Randy Brukardt
2007-12-12 11:37                       ` Exceptions Niklas Holsti
2007-12-12 13:14                         ` Exceptions Dmitry A. Kazakov
2007-12-12 14:37                       ` Exceptions Robert A Duff
2007-12-13 19:20                         ` Exceptions Randy Brukardt
2007-12-13 20:15                           ` Exceptions Robert A Duff
2007-12-12 11:00                     ` Exceptions Dmitry A. Kazakov
2007-12-11  2:12           ` Exceptions Randy Brukardt
2007-12-11 15:17             ` Exceptions Robert A Duff
2007-12-12  0:10               ` Exceptions Randy Brukardt
2007-12-13 19:58                 ` Exceptions Robert A Duff
2007-12-14  0:53                 ` Exceptions Ray Blaak
2007-12-14  2:48                   ` Exceptions Randy Brukardt
2007-12-14  6:33                     ` Exceptions Ray Blaak
2007-12-08 10:03 ` Exceptions Stephen Leake

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