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,a070c512f8bdd68e X-Google-Attributes: gid103376,public From: "Steve Folly" Subject: Re: Access Types Date: 1999/07/22 Message-ID: <932674911.9494.0.nnrp-01.c2de848f@news.demon.co.uk>#1/1 X-Deja-AN: 504136780 X-NNTP-Posting-Host: follysplace.demon.co.uk:194.222.132.143 References: <7mkgqq$elo$1@dailyplanet.wam.umd.edu> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 932674911 nnrp-01:9494 NO-IDENT follysplace.demon.co.uk:194.222.132.143 X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 1999-07-22T00:00:00+00:00 List-Id: Robert A Duff wrote in message news:wcchfmxsy3y.fsf@world.std.com... > rayoub@wam.umd.edu (Ronald Ayoub) writes: > > type Pointer_To_Const is access constant Integer; > type Pointer_To_Var is access all Integer; > > X: Pointer_To_Const := ...; > Y: Pointer_To_Var := ...; > > Z: constant Pointer_To_Const := ...; > W: constant Pointer_To_Var := ...; > > X.all := 1; -- Illegal. > X := new Integer'(3); -- OK. > Y.all := 1; -- OK. > Y := new Integer'(3); -- OK. > > Z.all := 1; -- Illegal; > Z := new Integer'(3); -- Illegal. > W.all := 1; -- OK. > W := new Integer'(3); -- Illegal. > > ... > > X and Y are constants; Z and W are variables. > > The objects Y and W point to are variables. > The objects X and Z point to might be constant or variable, > but they're read-only via X.all and Z.all. > > - Bob > -- > Change robert to bob to get my real email address. Sorry. That makes perfect sense for declared variables. But what about subprogram access type parameters. For example, you can have... function Foo(Bar : access Object) return Boolean; Which means the function takes an access to an Object variable. The function is free to change the value of the variable that Bar 'points' to. What seems to be missing is something along the lines of... function Foo(Bar : access constant Object) return Boolean; Which would imply that the function cannot change the variable the Bar points to. Why is this not included in the language definition. Is there an alternative? -- Regards, Steve Folly - Y2K compliant since 32nd Februark 1998 http://www.follysplace.demon.co.uk donationsto:myaccount@mybank.co.uk