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: Robert A Duff Subject: Re: Access Types Date: 1999/07/21 Message-ID: #1/1 X-Deja-AN: 503614299 Sender: bobduff@world.std.com (Robert A Duff) References: <7mkgqq$elo$1@dailyplanet.wam.umd.edu> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1999-07-21T00:00:00+00:00 List-Id: rayoub@wam.umd.edu (Ronald Ayoub) writes: > For this line of code: > > type File_Access is access constant File_Type; > > I understand this to mean that File_Access points to a File_Type variable > which cannot be changed but the value pointed to can be changed. Is this > correct? Um, the thing pointed to *is* the File_Type variable. Maybe this will help: 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.