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,289dc5ca8f87113c X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!195.71.90.67.MISMATCH!news.unit0.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: accessibility of objects Date: Sun, 05 Dec 2010 00:35:33 +0100 Organization: A noiseless patient Spider Message-ID: <87sjydt8l6.fsf@ludovic-brenta.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="W+LBYetK/9ACeiUzFfvLZA"; logging-data="30972"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Chbe1ogIp88sWdFR00Av1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:Qys4BbX1k7u/ZRBr3iuxiIvmiAQ= sha1:tUp9n1drwr1nz9gAyJCY2rLK4yI= Xref: g2news2.google.com comp.lang.ada:16783 Date: 2010-12-05T00:35:33+01:00 List-Id: george writes on comp.lang.ada: > Hello, I have been wrestling with an issue for some time, and now Im > looking for if someone has a good solution. > > I what to have a "package" where i have routins that I want to call > from another code/package. while this first package need to store > items/records that are defined in the calling package. Ada just wont > let me do such construct, what shall I use. I typically get "type > extension at deeper accessibility level than parent" or something else > problem. I just want this utility program to store essentially in old > language a pointer to my object, and dont care about the structure of > the object, and then return me the pointer att appropriate time. How many objects does your package need to store? If the answer is only 1 then that's a singleton and you probably don't need any pointers or access values at all. If the answer is "many" then I suggest you use a predefined container. Ada 2005 has a selection of Vectors, Maps, Sets, Ordered_Sets and Doubly_Linked_Lists; see section A.18 in the Ada 2005 Reference Manual [1]. If you use a compiler that only supports Ada 95 then I recommend you use the Charles library [2]. [1] http://www.adaic.com/standards/05rm/html/RM-TOC.html [2] http://charles.tigris.org/ HTH -- Ludovic Brenta.