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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,daf1e35a4e978e9d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-06-21 17:50:30 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: have to use unrestricted access but just what about access Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Sat, 22 Jun 2002 00:49:56 GMT References: <0x8Q8.6779$ZP1.1263481@news11-gui.server.ntli.net> <5ee5b646.0206210345.2d58d8e0@posting.google.com> NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:26581 Date: 2002-06-22T00:49:56+00:00 List-Id: dewar@gnat.com (Robert Dewar) writes: > Robert A Duff wrote in message news:... > > "chris.danx" writes: > > > > > How can the unrestricted_access attribute be replaced by just access in the > > > following code? > > > > You should be using 'Unchecked_Access here, which is a standard feature > > of Ada (albeit unsafe). > > > > 'Unrestricted_Access is a feature of GNAT, and is not necessary in your > > example. > > > > - Bob > > Bob look again! > One of the nasty restrictions in Ada 95 is that you cannot make parameters > aliased. This means that they can never be used in access attributes. This > is indeed one use of unrestricted access that is useful and legitimate, though > of course passing such an access value out assumes call by reference, and you > have to be sure that you can gaurantee call by reference. Oh. I thought we were talking about a *component* of a parameter, where the component was explicitly declared aliased. Also, you can make a parameter aliased by making it tagged. I agree that this is a nasty restriction in Ada 95 -- one ought to be allowed to declare the parameter aliased explicitly, and taggedness shouldn't have anything to do with the matter. - Bob