comp.lang.ada
 help / color / mirror / Atom feed
From: jsa@alexandria.organon.com (Jon S Anthony)
Subject: Re: Which compiler is correct?
Date: 1997/06/24
Date: 1997-06-24T00:00:00+00:00	[thread overview]
Message-ID: <JSA.97Jun24125610@alexandria.organon.com> (raw)
In-Reply-To: 867075736.16958@dejanews.com


In article <867075736.16958@dejanews.com> Mats.Weber@elca-matrix.ch writes:

<<emailed as well...>>


> 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




  reply	other threads:[~1997-06-24  0:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-17  0:00 Which compiler is correct? Tom Moran
1997-06-18  0:00 ` Pascal Obry
1997-06-18  0:00   ` Tom Moran
1997-06-18  0:00 ` Robert A Duff
1997-06-18  0:00   ` John Woodruff
1997-06-19  0:00     ` Robert A Duff
1997-06-20  0:00     ` Jon S Anthony
1997-06-21  0:00       ` Robert A Duff
1997-06-26  0:00         ` Jon S Anthony
1997-06-19  0:00   ` Simon Wright
1997-06-20  0:00     ` Jon S Anthony
1997-06-21  0:00       ` Robert A Duff
1997-06-21  0:00     ` Robert A Duff
1997-06-21  0:00       ` Simon Wright
1997-06-23  0:00       ` Mats.Weber
1997-06-24  0:00         ` Jon S Anthony [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-09-10  0:00 Which compiler is correct?? Robert B. Love 
1996-09-10  0:00 ` Robert Dewar
1996-09-10  0:00 ` Robert Dewar
1996-09-11  0:00   ` Robert B. Love 
1996-09-11  0:00 ` Jon S Anthony
1996-09-11  0:00 ` Robert A Duff
1996-09-12  0:00   ` Ken Cowan
1996-09-12  0:00   ` Ken Cowan
1996-09-13  0:00   ` Jon S Anthony
1996-09-12  0:00 ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox