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,FREEMAIL_FROM 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!news1.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: contracted exceptions Date: Sun, 10 Jun 2007 12:49:46 +0100 Organization: Pushface Message-ID: References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> <1it2vtizha2fi$.jxnoaxmm9sop$.dlg@40tude.net> <12vqux55uf5rn.1u5enj1mh0ubk$.dlg@40tude.net> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1181476187 10430 62.49.19.209 (10 Jun 2007 11:49:47 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sun, 10 Jun 2007 11:49:47 +0000 (UTC) Cancel-Lock: sha1:GgGcowR9U+OT1kuYzAn5Lw98JeM= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (darwin) Xref: g2news1.google.com comp.lang.ada:16145 Date: 2007-06-10T12:49:46+01:00 List-Id: "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? And why > would you rely on this handling, provided that it is exactly one who > first violated the contract? How is the callee supposed to handle the contract violation? The whole program is unsafe.