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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.29.76 with SMTP id p12mr6575828qac.5.1374024607557; Tue, 16 Jul 2013 18:30:07 -0700 (PDT) X-Received: by 10.49.58.242 with SMTP id u18mr221695qeq.23.1374024607543; Tue, 16 Jul 2013 18:30:07 -0700 (PDT) Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!t19no1766241qam.0!news-out.google.com!ij2ni362qab.0!nntp.google.com!t19no1891960qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 16 Jul 2013 18:30:07 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 References: <1d4tuwlfdnz2j$.18l68s96x3vjj.dlg@40tude.net> <984821833395507830.672948rm-host.bauhaus-maps.arcor.de@news.arcor.de> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: The future of Spark . Spark 2014 : a wreckage From: Shark8 Injection-Date: Wed, 17 Jul 2013 01:30:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Original-Bytes: 3246 Xref: number.nntp.dca.giganews.com comp.lang.ada:182538 Date: 2013-07-16T18:30:07-07:00 List-Id: On Monday, July 15, 2013 6:16:56 PM UTC-6, Randy Brukardt wrote: > "Georg Bauhaus" wrote in message=20 > news:984821833395507830.672948rm-host.bauhaus-maps.arcor.de@news.arcor.de= ... > > "Dmitry A. Kazakov" wrote: > > > >> I don't see how adding optional exception contracts should disrupt > >> anything. > > > > Aren't exceptions already part of contracts? Implied, though. >=20 > Yes, but only for inbound contracts (preconditions and predicates). We ne= ed=20 > them for outbound contracts as well, without having to guess. And I agree= =20 > with Dmitry that those need to be compile-time checked in the subprogram= =20 > bodies. (Exactly how that's done has to be worked out, of course). >=20 > procedure Op (x : in out T) > with Post =3D> Foo(x), > Exception =3D> Constraint_Error when not Foo(x); > or something like that. >=20 > Randy. I think you and I talked about that idea (basically sets of exceptions) and= I like the idea a lot (though not the particular syntax you were using, wh= ich is ok) -- I really like the idea you have for renaming the violation ex= ception, in retrospect that would have been very desirable for constraint-a= spect violations (pre-/post-conditions, particularly). The one drawback from your proposal is that it makes you reiterate the cond= ition, 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 =3D> (Constraint_Error at [not?] Foo(x)); which would reuse the keyword(s) AT [and NOT] in addition to preventing the= unnecessary duplication. {The use of parenthesis could also be mandated th= at way the clauses [which are different constitutions] could be made/forced= -distinct when they are to raise differing exceptions on violation.}