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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dd23af7a2f4f9e7c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-03 16:58:17 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 03 Jan 2004 18:58:15 -0600 Date: Sat, 03 Jan 2004 19:58:15 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Mutable parameter of a function (long ago was: Re: What evil would happen?) References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <-MWdnftXl-K1-GqiRVn-hQ@comcast.com> NNTP-Posting-Host: 24.34.214.193 X-Trace: sv3-kmrMH7kJ9+QYvn/Qhdz07X1q4FaPAdBbRhpXIvtM8Tbd7kiTZ1Tzvz6pD+l+iPeBxjgDY8V68et/evV!aaKW2T5/vIEwl9eFaG1/NAIX9hjoqbZXB/zkKd/2e1OjSGIG0Z4teHRvl6ouNA== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:4091 Date: 2004-01-03T19:58:15-05:00 List-Id: Dmitry A. Kazakov wrote: > No, it is better never use tricks. The Rosen trick is in general an ability > for an object to identify itself in all context, even in ones stating > something opposite about it. That is an extremely dangerous thing, which > breaks substitutability and so the contract. Is this the motivation for > exposing this potential contract violation to code maintainer using a > pragma? But that would by no means solve the problem. It would make things > only worse. It would say, look, this is an in-parameter, but wait, that was > just joking, because, here is a pragma, carefully hidden somewhere else, > that states the opposite. As long as the use does comply with the ADT model it doesn't bother me. This is certainly the case with a random number generator. The model is that calling Random uses the generator but doesn't modify it. There are other operations in the random number package that do change the generator state, and do have the correct (in out) interface. (Yes, I know that the call really does change some hidden values in the generator, but that is equivalent to having a pointer in the generator, and changing values in the target of the pointer. But if I did have the pragma available, I'd put it in the private part... > IMO it would be difficult to make it in a consistent way without reviewing > the ADT model in Ada. But the time will come, I hope. Sort of my point. It would be nice to "improve" Ada with constant subtypes. But there are a lot more useful things to do first, then see if they fit. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush