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-Thread: 103376,5524603d74cda791 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns14feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Inter-object pointer problem References: <1147806613.377038.169250@j33g2000cwa.googlegroups.com> In-Reply-To: <1147806613.377038.169250@j33g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <2kqag.975795$xm3.614021@attbi_s21> NNTP-Posting-Host: 12.201.97.176 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1147810174 12.201.97.176 (Tue, 16 May 2006 20:09:34 GMT) NNTP-Posting-Date: Tue, 16 May 2006 20:09:34 GMT Date: Tue, 16 May 2006 20:09:34 GMT Xref: g2news2.google.com comp.lang.ada:4278 Date: 2006-05-16T20:09:34+00:00 List-Id: Alex Catlin wrote: > > The problem is that generic package A is expecting to be instantiated > with an access type, but the Ptr_B doesnt exist until I have called > procedure X. If this were C I would instantiate A_Structure as a static > type during procedure X so it didn't keep making new A's every call, > but I dont think I can do that in ADA. Is there a fix based on some > concept i'm completely missing or am I going to have to completely > change the organisation of the program? This is so far from being correct Ada that it's impossible to tell what you're trying to do, but I'd suggest you pull the instantiation of B_Pkg out of the procedure. If you can provide a better example, with information such as the specifications of the packages and the definition of B_Pointer_Type, we can probably help you better. It's likely you don't need access types or values at all outside the packages; pointers are needed far less often in Ada than in C (compiler writers excepted). Finally, "Ada" is a woman's name, not the American Dental Association (or other acronym). People on c.l.a get more or less upset with others who don't capitalize it correctly. -- Jeff Carter "If you don't get the President of the United States on that phone, ... you're going to have to answer to the Coca-Cola Company." Dr. Strangelove 32