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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd40601768eaf8fd X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: 'constant functions' and access constant params (was Re: Array of Variant Records Question...) Date: 1999/09/23 Message-ID: <37ea53fe@news1.prserv.net>#1/1 X-Deja-AN: 528691823 Content-transfer-encoding: 7bit References: <7r5vh3$imu1@svlss.lmms.lmco.com> <37d6a45c@news1.prserv.net> <37d6ccb6@news1.prserv.net> <7r77i8$i08$1@nnrp1.deja.com> <37d7c116@news1.prserv.net> <7r8t21$ov5$1@nnrp1.deja.com> <37d822a1@news1.prserv.net> <7reg02$t83@dfw-ixnews6.ix.netcom.com> <37DE8D09.C863CBC9@rational.com> <7roohh$s6r@dfw-ixnews7.ix.netcom.com> <37e01168@news1.prserv.net> <7rp86o$c6h@dfw-ixnews3.ix.netcom.com> <37E18CC6.C8D431B@rational.com> <7rs8bn$s6@dfw-ixnews4.ix.netcom.com> <37e2e58c@news1.prserv.net> <7s9nd0$cbe@dfw-ixnews17.ix.netcom.com> <37e8e067@news1.prserv.net> <7sas3p$bfa@dfw-ixnews3.ix.netcom.com> <37e994c0@news1.prserv.net> <37E9B259.7C58@l5i.net> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 23 Sep 1999 16:23:26 GMT, 32.101.8.225 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-09-23T00:00:00+00:00 List-Id: In article <37E9B259.7C58@l5i.net> , Vincent Marciante wrote: > Would the following (or similar) also require consideration? > Doesn't it also exhibit a loophole? If not, why not? We were only talking about state changes that violate the terms of the contract between client and supplier (although Richard and I do not agree on the exact nature of that contract). Your example illustrates the point I was trying to make: the postcondition is "formal.ref1.all = old formal.ref1.all + 1", and the subprogram does indeed satisfy that postcondition. Here, the state is completely public, but no illicit state changes have taken place other that what were promised. I suppose if you wanted to be completely doctrinaire you could pass Formal as an in-out mode parameter, but I don't recommend this. It's no secret that Formal is a record the contains access objects, and that the function inc_formal_ref1_object modifies the value designated by the access object, not the access object itself. So just pass Formal as in-mode. Your function does exactly what it promised to do: nothing more, and nothing less. So as far as I am concerned, there is no problem with it. -- Those who believe in the supernatural should be required to learn computer programming. This would force them to discover that things which appear to be completely mysterious and incomprehensible, in fact have a logical, and usually simple, explanation. J. B. R. Yant, Mortal Words