comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph" <christoph.grein@eurocopter.com>
Subject: Re: Giving a package specification access to the private types of another package
Date: Tue, 10 Dec 2002 15:27:31 +0100 (MET)
Date: 2002-12-10T15:27:31+01:00	[thread overview]
Message-ID: <mailman.1039530902.542.comp.lang.ada@ada.eu.org> (raw)

> It already is, but I have the same problem. I think if A is a child of
> B then the body of A can see the body of B, but the public specification of

No, that's wrong. No unit can ever see inside the body of another unit. The body 
is hidden from all visibility.

> A cannot see the body of B (which is what I need).

A child'body of a unit can see in the private part of its parent.
A private child's spec can see in the private part of its parent.
A child's private part can see in the private part of its parent.

Privateness can be nested. You can have private children of public parents, but 
also public children of private parents and private children of private parents. 


        package A     is ... end A;
private package A.B   is ... end A.B;
        package A.B.C is ... end A.B.C;  -- public within A.B
private package A.B.D is ... end A.B.D;  -- private within A.B

A.B.C'Spec does not see A.B.D (because the latter is private).
A.B.C'Body does see A.B.D'Spec.

with A;      -- legal
with A.B;    -- illegal
with A.B.C;  -- illegal
package X is ...



             reply	other threads:[~2002-12-10 14:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-10 14:27 Grein, Christoph [this message]
2002-12-10 14:46 ` Giving a package specification access to the private types of another package Steven Murdoch
2002-12-10 15:08   ` John Cupak
2002-12-10 15:31     ` Steven Murdoch
  -- strict thread matches above, loose matches on Subject: below --
2002-12-12  7:14 Grein, Christoph
2002-12-12 17:01 ` Jeffrey Carter
2002-12-13 20:25   ` Steven Murdoch
2002-12-11  5:51 Grein, Christoph
2002-12-11 19:22 ` Jeffrey Carter
2002-12-10 13:51 Steven Murdoch
2002-12-10 13:53 ` Preben Randhol
2002-12-10 14:07   ` Steven Murdoch
2002-12-10 14:37     ` James S. Rogers
2002-12-10 14:54       ` Steven Murdoch
2002-12-10 15:54         ` Robert A Duff
2002-12-10 16:58           ` Steven Murdoch
2002-12-11  2:43             ` SteveD
2002-12-10 19:42     ` Stephen Leake
2002-12-10 14:36   ` Steven Murdoch
replies disabled

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