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,a85dd10bdbdb69d4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-11 11:23:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3DF7909C.1090800@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Giving a package specification access to the private types of another package References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 11 Dec 2002 19:22:05 GMT NNTP-Posting-Host: 63.184.104.126 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1039634525 63.184.104.126 (Wed, 11 Dec 2002 11:22:05 PST) NNTP-Posting-Date: Wed, 11 Dec 2002 11:22:05 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:31705 Date: 2002-12-11T19:22:05+00:00 List-Id: Grein, Christoph wrote: > This is indeed the perfect design for your problem. > >>I think this is what I have done - and it works. My code is equivalent >>to the example below. This works and seems to be the best way to do it. >> >>package B is >> procedure Proc_B; >>private >> type Private_Type is new Integer; >>end B; >> >>with B.A; >>package body B is >> procedure Proc_B is >> Temp: Private_Type; >> begin >> A.Foobar(Temp); >> end; >>end B; >> >>private package B.A is >> procedure Foobar(Temp: in Private_Type); >>end B.A; >> >>package body B.A is >> procedure Foobar(Temp: in Private_Type) is >> begin >> null; >> end; >>end B.A; Perfect? That's a bit strong. It's a good design, but as given, I think that putting Foobar in B (perhaps with "is separate") is as good. -- Jeff Carter "Beyond 100,000 lines of code you should probably be coding in Ada." P. J. Plauger