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,d4f6f490613e0fd8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-25 21:39:53 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!howland.erols.net!netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3B0F338C.8B16CE09@acm.org> From: Jeffrey Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: access types and head pains References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 26 May 2001 04:39:48 GMT NNTP-Posting-Host: 209.86.210.238 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 990851988 209.86.210.238 (Fri, 25 May 2001 21:39:48 PDT) NNTP-Posting-Date: Fri, 25 May 2001 21:39:48 PDT Organization: EarthLink Inc. -- http://www.EarthLink.net X-Received-Date: Fri, 25 May 2001 21:38:04 PDT (newsmaster1.prod.itd.earthlink.net) Xref: archiver1.google.com comp.lang.ada:7797 Date: 2001-05-26T04:39:48+00:00 List-Id: "chris.danx" wrote: > > package X is > > type A is private > type A_ac is access all A; > ... > > procedure Do_S (av : in out A_ac; v : any_type ); > > -- with body > -- is begin > -- av.v := v; etc > > end X; > > procedure test is > at : aliased A; > begin > Do_S (at'unchecked_access, 2); > end test; > > i got an error that said "at actual must be a variable". What's wrong? > > The idea is that the driver will work with two different kinda things in the > same procedure. "at" can be declared in program or be a chunk of memory of the > same size. Any hints? I suspect your message read "av actual ...". The parameter av is mode in out, which means Do_S may modify it. You can't change at'unchecked_access, because then it wouldn't be at'unchecked_access any more. Unless you have "av := ...;" in Do_S, why not just make it mode in? -- Jeff Carter "I waggle my private parts at your aunties." Monty Python & the Holy Grail