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!news1.google.com!news.glorb.com!newsfeed2.telusplanet.net!newsfeed.telus.net!edtnps90.POSTED!53ab2750!not-for-mail Sender: blaak@METROID Newsgroups: comp.lang.ada Subject: Re: contracted exceptions References: <1181165630.012508.55290@i38g2000prf.googlegroups.com> <19fxsxv1god43$.1pqq8vgfu2itn$.dlg@40tude.net> From: Ray Blaak Message-ID: Organization: The Transcend User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 08 Jun 2007 08:53:28 GMT NNTP-Posting-Host: 154.20.94.243 X-Trace: edtnps90 1181292808 154.20.94.243 (Fri, 08 Jun 2007 02:53:28 MDT) NNTP-Posting-Date: Fri, 08 Jun 2007 02:53:28 MDT Xref: g2news1.google.com comp.lang.ada:16099 Date: 2007-06-08T08:53:28+00:00 List-Id: "Dmitry A. Kazakov" writes: > On Thu, 7 Jun 2007 21:19:08 -0500, Randy Brukardt wrote: > Shouldn't "contracted exceptions" actually mean statically contracted ones? > IMO, a contract can be violated only by the [buggy] compiler. Some points: Even with a perfect compiler and runtime, one still has to be prepared to handle unexpected errors due to the environment (e.g. someone yanks out the network cable, etc.). Say you have a contract for a particular exception to occur or not occur. Now how has your behaviour changed with that knowledge? In my experience, in the usual case, it's nothing in real terms. All that is usually desired is to perculate it upward. In the occasional situations where one needs to cleanup before rethrowing, one tends to need to do that for any exception, not particular ones. In practical terms, an exception contract primarily affects the programmer in forcing them to ensure that callers' contracts are compatible. This is artificial work. An exception's type and details are primarily useful for (eventually) showing to the user, to aid in post-analysis of the problem. -- Cheers, The Rhythm is around me, The Rhythm has control. Ray Blaak The Rhythm is inside me, rAYblaaK@STRIPCAPStelus.net The Rhythm has my soul.