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: a07f3367d7,f473cbaae52e095d X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Indirect visibility of private part in child packages Date: Thu, 04 Jun 2009 09:22:05 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <77683561-2b21-42c3-8c90-6c08a0c16b99@n21g2000vba.googlegroups.com> <5854cebc-55a9-469d-88bd-86b4704f8689@c19g2000yqc.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls6.std.com 1244121725 20080 192.74.137.71 (4 Jun 2009 13:22:05 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 4 Jun 2009 13:22:05 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:XVXGiQuzrQhyqhU93lT9TlzNTgs= Xref: g2news2.google.com comp.lang.ada:6237 Date: 2009-06-04T09:22:05-04:00 List-Id: "Hibou57 (Yannick Duch�ne)" writes: > On 4 juin, 09:50, Ludovic Brenta wrote: >> Maybe you can solve your problem like this: >> >> package body P1.P3 is >> � �procedure A_Primitive (Item : out T3_Type) is >> � �begin >> � � � T1_Type (Item).Low_Level_Data := ...; >> � �end A_Primitive; >> end P1.P3; > > I've just tried it, and it does not work better. The compiler > complains there are not selector Low_Level_Data for T1_Type. Are you sure? Converting to T1_Type should work. P3 can see that T1_Type has a Low_Level_Data component. The reason your original example didn't work is that the components of T2_Type are "nailed down" at the point where it's declared, and P3 can't see that. It can, however, see that it's derived from T1_Type, so converting should work. >> � �procedure Set (Item : out T1_Type; Data : in Some_Type); >> end P1; >> >> package body P1.P3 is >> � �procedure A_Primitive (Item : out T3_Type) is >> � �begin >> � � � Set (Item, Data => ...); -- OK, calls inherited primitive >> operation >> � �end A_Primitive; >> end P1.P3; >> >> HTH > > I will try it soon and tell about the result. But at first sight, I > think that the compiler gonna complain that Set is a primitive of > T1_Type and thus that it must be defined in the public part. Further > more, I think Set would habe to be redefined for each T2_Type, T3_Type > and etc. You could make Set class-wide. - Bob