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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: The future of Spark . Spark 2014 : a wreckage Date: Wed, 17 Jul 2013 18:08:17 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1d4tuwlfdnz2j$.18l68s96x3vjj.dlg@40tude.net> <984821833395507830.672948rm-host.bauhaus-maps.arcor.de@news.arcor.de> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1374102497 3798 69.95.181.76 (17 Jul 2013 23:08:17 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 17 Jul 2013 23:08:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:16398 Date: 2013-07-17T18:08:17-05:00 List-Id: "Shark8" wrote in message news:e7de5753-5819-41a4-a40f-3d80c101bf03@googlegroups.com... ... >The one drawback from your proposal is that it makes you reiterate the >condition, >but with a negation, this could be a source of bugs. Even though it's a >little less >straightforward the following would circumvent that problem: > procedure Op (x : in out T) > with Post => (Constraint_Error at [not?] Foo(x)); I didn't mean this to be a real example. An example like the one given probably would have been better written as a precondition (depending on exactly what Foo does): procedure Op (x : in out T) with Pre => Foo(x) or else raise Constraint_Error, Post => Foo(x); which is just normal Ada 2012 code (using the raise expression, which we added 'after the fact' to support this usage). I don't think most exception contracts would have an associated postcondition (that is, cause); what would the postcondition be for Use_Error, for instance? It's just an optional help in a few circumstances. Randy.