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,7d83a6223f4f2443 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Run-time accessibility checks Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4940f7be$0$30232$9b4e6d93@newsspool1.arcor-online.net> Date: Thu, 11 Dec 2008 12:40:32 +0100 Message-ID: <1abvztyo27831.169xig7skkqig$.dlg@40tude.net> NNTP-Posting-Date: 11 Dec 2008 12:40:32 CET NNTP-Posting-Host: 38e36e52.newsspool3.arcor-online.net X-Trace: DXC=D7Wk;4iO]37L2C_`koXfC5McF=Q^Z^V384Fo<]lROoR1^YC2XCjHcb99W17=RC[jS1DNcfSJ;bb[5FCTGGVUmh?4LK[5LiR>kg2IHf\C^^Z_=: X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:2960 Date: 2008-12-11T12:40:32+01:00 List-Id: On Thu, 11 Dec 2008 12:21:34 +0100, Georg Bauhaus wrote: > Dmitry A. Kazakov schrieb: > >> This is what I call abstract record interface. For each component it will >> have two operations: >> >> function "." (R : Abstract_Record_Type) >> return Component_Type is abstract; >> procedure "." >> (R : in out Abstract_Record_Type; C : Component_Type) is abstract; >> >> The compiler uses the second (setter) for all LHS X.Component. > > That with pre/post/invariant constraints, in case the > component setting procedure has access to the object > containing the component. It is a primitive operation of the abstract record type, but not of the component. If you wanted to have it a primitive operation of both, you would have to support MD, which is I don't know how to do (properly). > Could pre/post/invariant also help when checking order of > component assignments? Which order? A record type does not declare any specific access order for its components. If you have record aggregates in mind that is another interface and another issue. Aggregate is a form of a constructor with some special syntax. > (These are called "assigner commands" in Eiffel.) There are pretty clear rules about what happens with pre/post/invariant upon inheritance (Liskov). The only problem is that many people (like Meyer and possibly you) honestly believe they could make pre/post/invariant dynamic. Count me out. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de