comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria.organon.com (Jon S Anthony)
Subject: Re: Building blocks (Was: Design By Contract)
Date: 1997/09/18
Date: 1997-09-18T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97Sep18155753@alexandria.organon.com> (raw)
In-Reply-To: wihnDCAGPDI0IwlD@treetop.demon.co.uk


In article <wihnDCAGPDI0IwlD@treetop.demon.co.uk> Paul Johnson <Paul@treetop.demon.co.uk> writes:

> >It is only "superior" if you think that Bertrand Meyer's proposed theory
> >about exceptions is the only valid one. I don't think it is - and just to
> >the contrary, I consider something like Eiffel's class EXCEPTION an ugly
> >hack to differentiate between kinds of exceptions.
> 
> Which suggests that you are missing the point about DBC.

Or that he sees the point and doesn't think much of it in this
context.


> What is important is the fact that ignoring an exception is not an
> option.  DBC requires that a class either fulfil its contract or raise
> an exception.  The client class which recieves the exception can either
> try again a different way or pass the exception on to its client.
> Simply hiding the failure under the carpet is not an option.  The
> precise nature of the exception is much less important than its
> existance.

OK, but the existence of the exception is not something you can just
completely forget about with no effect.  Either you handle it (ala'
Eiffel) or you don't and then it will eventually get handled (by
someone else) or fall out the bottom and halt the program.


> Ada allows the programmer to quietly ignore an exception and pretend
> that a routine succeeded when in fact it failed.  This is wrong.

How do you figure that?  The only way to "quietly ignore" an exception
is to explicitly handle it _by_ ignoring it:


...
    begin
    ... whatever

    exception
        when others =>
            null;  -- Dirty trick on the client, blow up but
                   -- ignore that fact and pretend it didn't happen.
    end;

I'm not sure how this is really any different than hacking a similar
dirty trick in Eiffel where you simply pretend that things worked OK
(so called, "organized panic" or it's slight variant "resumption").
And you don't need to put in any rescue clause and you just end up
with the default (all the way back to ANY's which does nothing).  This
last is really no different at all from what happens if you have no
user handlers in the Ada case.  I guess the point is simply that
Eiffel does not _ensure_ things will be "done right" any more than Ada
does or for that matter the Java/IDL model.

/Jon
-- 
Jon Anthony
STL, Belmont, MA 02178, 617.484.3383 
"Nightmares - Ha!  The way my life's been going lately,
 Who'd notice?"  -- Londo Mollari






  parent reply	other threads:[~1997-09-18  0:00 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-09  0:00 Building blocks (Was: Design By Contract) Marc Wachowitz
1997-09-15  0:00 ` Joachim Durchholz
1997-09-17  0:00 ` Paul Johnson
1997-09-18  0:00   ` Stephen Leake
1997-09-18  0:00     ` W. Wesley Groleau x4923
1997-09-21  0:00       ` Matthew Heaney
1997-09-18  0:00     ` Mark L. Fussell
1997-09-19  0:00       ` Robert A Duff
1997-09-20  0:00         ` Joachim Durchholz
1997-09-22  0:00           ` Matthew Heaney
1997-09-23  0:00             ` Joachim Durchholz
1997-09-23  0:00             ` Veli-Pekka Nousiainen
1997-10-03  0:00               ` Robert I. Eachus
1997-10-04  0:00                 ` Paul Johnson
1997-10-14  0:00                   ` Robert I. Eachus
1997-09-23  0:00           ` Jon S Anthony
1997-09-24  0:00           ` Alan E & Carmel J Brain
1997-09-25  0:00             ` Anonymous
1997-09-30  0:00               ` Alan E & Carmel J Brain
1997-09-30  0:00                 ` Matthew Heaney
1997-09-30  0:00                   ` Neil Wilson
1997-09-30  0:00                     ` Stephen Leake
1997-09-30  0:00                   ` W. Wesley Groleau x4923
1997-09-30  0:00                     ` Matthew Heaney
1997-10-01  0:00                     ` Alan E & Carmel J Brain
1997-10-01  0:00                 ` Anonymous
1997-10-01  0:00                   ` Paul M Gover
1997-10-04  0:00                     ` Paul Johnson
1997-10-04  0:00                       ` Matthew Heaney
1997-10-15  0:00                         ` Paul Johnson
1997-10-15  0:00                           ` Matthew Heaney
1997-10-16  0:00                             ` Joachim Durchholz
1997-10-17  0:00                               ` Robert I. Eachus
1997-10-16  0:00                           ` Joachim Durchholz
1997-10-22  0:00                           ` Reimer Behrends
1997-10-01  0:00                   ` Joachim Durchholz
1997-10-02  0:00                   ` Robert A Duff
1997-10-02  0:00                     ` Tucker Taft
1997-10-02  0:00                       ` Matthew Heaney
1997-10-03  0:00                     ` Stephen Leake
1997-10-04  0:00                     ` Matthew Heaney
1997-10-07  0:00                       ` Robert A Duff
1997-09-24  0:00           ` Richard A. O'Keefe
     [not found]       ` <11861963wnr@eiffel.demon.co.uk>
1997-09-19  0:00         ` Mark L. Fussell
1997-09-19  0:00       ` Jon S Anthony
1997-09-23  0:00         ` Mark L. Fussell
1997-09-18  0:00   ` Jon S Anthony [this message]
1997-09-18  0:00   ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
1997-09-11  0:00 Robert Dewar
1997-09-09  0:00 Marc Wachowitz
1997-09-02  0:00 Design By Contract Jon S Anthony
     [not found] ` <JSA.97Sep3201329@alexandria.organon.com>
1997-09-04  0:00   ` Paul Johnson
     [not found]     ` <5un58u$9ih$1@gonzo.sun3.iaf.nl>
1997-09-06  0:00       ` Building blocks (Was: Design By Contract) Joachim Durchholz
1997-09-08  0:00       ` Paul Johnson
1997-09-08  0:00         ` Brian Rogoff
1997-09-09  0:00           ` Matthew Heaney
1997-09-09  0:00             ` Brian Rogoff
1997-09-09  0:00             ` W. Wesley Groleau x4923
1997-09-10  0:00               ` Robert A Duff
1997-09-12  0:00                 ` Jon S Anthony
1997-09-10  0:00             ` Paul Johnson
1997-09-10  0:00               ` Matthew Heaney
1997-09-10  0:00               ` Darren New
1997-09-10  0:00             ` Robert Dewar
1997-09-12  0:00               ` Jon S Anthony
1997-09-12  0:00                 ` Robert Dewar
1997-09-16  0:00                   ` Brian Rogoff
1997-09-12  0:00               ` Paul Johnson
1997-09-14  0:00                 ` Robert Dewar
1997-09-14  0:00                 ` Robert Dewar
1997-09-14  0:00                 ` Robert Dewar
1997-09-15  0:00                   ` John G. Volan
1997-09-09  0:00           ` W. Wesley Groleau x4923
1997-09-09  0:00           ` Veli-Pekka Nousiainen
1997-09-09  0:00             ` Jon S Anthony
1997-09-09  0:00           ` Veli-Pekka Nousiainen
replies disabled

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