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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,93dce172c8d3e2fb X-Google-Attributes: gid103376,public From: jsa@alexandria.organon.com (Jon S Anthony) Subject: Re: Which compiler is correct? Date: 1997/06/24 Message-ID: #1/1 X-Deja-AN: 252268884 Distribution: world References: <33A77C54.5484@bix.com> <867075736.16958@dejanews.com> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-06-24T00:00:00+00:00 List-Id: In article <867075736.16958@dejanews.com> Mats.Weber@elca-matrix.ch writes: <> > Sorry, but I still don't get it. What is wrong with the following > interpretation of the rules ? > > package a is > type x is tagged private; > private > type x is tagged record > i:integer; > end record; > end a; > package a.b is > type y is new x with private; > > This establishes, among other things, that y inherits x's components. Aha! This is where you are confused. This does _not_ establish that y inherits x's components because they are not yet visible. See 7.3.1 and pay particular attention to (3). > private > type y is new x with record > j:integer; > end record; It is at this point that x's components are visible and it is only at that point (when they become visible) that they are implicitly declared. > end a.b; > with a.b; > package a.c is > type z is new a.b.y with private; > > As y is visibly derived from x, we know that z is an ancestor of x. True, but since a.c does not see the private portion of a.b it does not see the implicitly declared components of y inherited from x, because the declaration that it does see does not have them. > full declaration of x. The "additional characteristic" that y has an i > component becomes visible No, since a.c does not have visibility to a.b's private portion, these components are not directly visible (they are there, you just can't see them unless you convert). > (because y inherits x's components, and that > fact was already established in y's private declaration). And that is why they aren't directly visible to a.c, as a.c can't see y's full declaration in a.b's private portion. /Jon -- Jon Anthony OMI, Belmont, MA 02178 617.484.3383 "Nightmares - Ha! The way my life's been going lately, Who'd notice?" -- Londo Mollari