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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,50137bb64a119cfc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-15 11:08:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: "access constant" discriminant Date: Sat, 15 Feb 2003 11:17:28 -0800 Organization: AdaWorks Software Engineering Message-ID: <3E4E9248.3E71D984@adaworks.com> References: <_TO1a.14664$9y2.6601@nwrddc01.gnilink.net> <3CS1a.55972$2H6.1357@sccrnsc04> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.41.d0 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 15 Feb 2003 19:08:28 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:34123 Date: 2003-02-15T19:08:28+00:00 List-Id: tmoran@acm.org wrote: > > why can't one say > type Lock_Type(Resource : access constant Resource_Type) ... > Did the designers foresee and forestall my use with a function? I raised an issue about this from time to time in this forum, but in a sligthly different way. We have, type Reference is access all some-type; and type Reference is acess constant some-type; A function may have a an access parameter, which almost has in semantics. However, it is possible to modify a component of an access parameter. I would like the option of preventing that with, function F (X : access constant parameter-name) return some-type; This would make it illegal for the function to modify the components of an access parameter. Without the word constant, one could still modify such components, but including it would make absolutely clear, in the contract, that such side-effects would be impossible. Richard Riehle