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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca3376f0e2c72c58 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-04 04:46:29 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!ppp-5-251.5800-6.access.uk.worldonline.COM!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: better way? Date: Wed, 3 Jan 2001 05:00:31 -0000 Message-ID: <931r2k$4ai5t$1@ID-25716.news.dfncis.de> References: <16D06.22140$A06.845242@news1.frmt1.sfba.home.com> NNTP-Posting-Host: ppp-5-251.5800-6.access.uk.worldonline.com (62.64.157.251) X-Trace: fu-berlin.de 978612117 4540605 62.64.157.251 (16 [25716]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: supernews.google.com comp.lang.ada:3648 Date: 2001-01-03T05:00:31+00:00 List-Id: I believe the orthodox answer to this would be that, since the two types Inner_A_Thing_Type and Inner_B_Thing_Type are so closely related, the definitions of these types and their primitive operations all belong immediately within the one package. I illustrate below (with names changed to hopefully increase clarity a tad). package MacDonalds_Ultra is type Diner_Type is [tagged] [limited] private; type Meal_Type is [tagged] [limited] private; procedure Eat (Diner: in out Diner_Type; Meal: in Meal_Type['Class]); procedure Configure_Nutritional_Balance (Meal: in out Meal_Type; Diner: in Diner_Type['Class]); ... private ... end MacDonalds_Ultra; It doesn't seem immediately obvious to me why you wouldn't want to adopt this approach, at least as a starting point. Sometimes it is useful to define further packages which present essentially the same types and operations in a different way. I think Ada.Text_IO shows a fairly good example of the meaningful use of inner packages. -- Nick Roberts http://www.AdaOS.org wrote in message news:16D06.22140$A06.845242@news1.frmt1.sfba.home.com... > I'd like to do something like: > package Outer is > > type Inner_A_Thing_Type; > type Inner_B_Thing_Type; > > package Inner_A is > type Thing_Type is ... > procedre P(X : access Inner_B_Thing_Type); > end Inner_A; > subtype Inner_A_Thing_Type is Inner_A.Thing_Type; > > package Inner_B is > type Thing_Type is ... > procedre Q(X : access Inner_A_Thing_Type); > end Inner_B; > subtype Inner_B_Thing_Type is Inner_B.Thing_Type; > ... > end Outer; > > but the "subtype" instead of "type" prevents it. Suggestions?