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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1b41412c7bc28c47 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Wed, 20 Aug 2008 09:42:17 +0200 From: Georg Bauhaus Reply-To: rm.tsoh-bauhaus@maps.futureapps.de User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: What is a Contract? (was: Suffix _T for types found good) References: <2e9ebb23-a68b-43cf-8871-febcb173f951@56g2000hsm.googlegroups.com> <4899d2af$0$19731$4d3efbfe@news.sover.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <48abcad9$0$11749$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 20 Aug 2008 09:42:17 CEST NNTP-Posting-Host: 8111c3a4.newsspool1.arcor-online.net X-Trace: DXC=oWOZR=Hde^DlU`@c^jLCbJic==]BZ:afN4Fo<]lROoRA4nDHegD_]RET=BaN;LlOUCA:ho7QcPOVClmgK1I:gGfNInA7FD^6;gC X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:1664 Date: 2008-08-20T09:42:17+02:00 List-Id: Ray Blaak wrote: > A type is a contract specifying behaviour and storage. In the context of Ada types, this use of the word "contract" is potentially eroding the very notion of contract. A type is not specific enough to be the same as a proper full contract: Behavior includes time. Most types don't say anything about time. Behavior includes order. Most types don't say anything about order of operations. The client party can choose any order of primitive operations they wish. They can expect the operations to have finished whenever these are done. No contractual specifics. Contracts say, "Provided earlier behavior X... ", "Provided property P of A ... ". Most Ada types do not and cannot currently have a contractual part of this sort. There are no premises right now, other than subtype constraints (recursively). The client party to a type-contract is typically *not* granted access to any piece of storage. Client parties only see the public view of a type. You could say that privacy is part of the contract. Sure. This is what I mean by eroding the notion of "contract". (It is typically not necessary to set up a contract between two parties when all that it specifies is, "Client will not tear castle's walls down." That's understood.) A contract for object of a type typically *exludes* aspects of storage. (Other than saying, this operation requires O(2*n) words of computer storage. Said in comments...) A contract is specific about expectations. "This function returns a String" is unspecific at the level of "contract". The client's expectation in the sense of contract is, "What kind of String will I get back?" I think it might be advantageous to let "contract" mean the essentials that make contract *different* from plain old Ada type. -- Georg Bauhaus Y A Time Drain http://www.9toX.d