From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f66d11aeda114c52 X-Google-Attributes: gid103376,public X-Google-Thread: fac41,f66d11aeda114c52 X-Google-Attributes: gidfac41,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Building blocks (Was: Design By Contract) Date: 1997/09/18 Message-ID: #1/1 X-Deja-AN: 273637604 References: <5v34m5$pl9$1@trumpet.uni-mannheim.de> Distribution: world Organization: PSINet Newsgroups: comp.lang.ada,comp.lang.eiffel Date: 1997-09-18T00:00:00+00:00 List-Id: In article Paul Johnson 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