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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,61e9062c1f23b9d5 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!213.132.189.1.MISMATCH!multikabel.net!feed10.multikabel.net!feeder.news-service.com!news.csl-gmbh.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: contracted exceptions From: Georg Bauhaus In-Reply-To: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> <1it2vtizha2fi$.jxnoaxmm9sop$.dlg@40tude.net> <12vqux55uf5rn.1u5enj1mh0ubk$.dlg@40tude.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-ID: <1181499256.27470.23.camel@sonnenregen> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Sun, 10 Jun 2007 20:14:16 +0200 NNTP-Posting-Date: 10 Jun 2007 20:15:52 CEST NNTP-Posting-Host: 7090f701.newsspool3.arcor-online.net X-Trace: DXC=OVBWF<_f]n=RadXUBHgFh3McF=Q^Z^V384Fo<]lROoR1Fl8W>\BH3Y219CKY`H65D5A:ho7QcPOV3jNoP5C`^PI>lAQmGhoV=O< X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:16148 Date: 2007-06-10T20:15:52+02:00 List-Id: On Sun, 2007-06-10 at 12:49 +0100, Simon Wright wrote: > "Dmitry A. Kazakov" writes: > > > On Sat, 09 Jun 2007 22:04:24 +0100, Simon Wright wrote: > > >> Also, this check is about a precondition, if the caller violates > >> the precondition she has no right to expect me not to raise > >> unheralded exceptions! > > > > Oh my. "If you don't do that, then I ..." (:-)) > > > > No, if the precondition was violated by the caller, then how this > > caller is supposed to handle the exception it does not know? If the precondition was violated by the caller then, yes, an assertion error will ensue; obviously, the caller is not prepared to handle the error because that's the point of contracts: that caller fulfills the precondition of callee and this will get it the postcondition, not the precondition or its violation. If not, there is a bug that the party that *states* the contract cannot take care of, being a callee whose contract was not fulfilled. Obviously, the caller has a bug. I have not yet heard of a way to document unknown caller bugs whatever contracts.