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,d10596e187e90822 X-Google-Attributes: gid103376,public From: Matthew Heaney Subject: Re: Private Children Date: 1999/06/21 Message-ID: #1/1 X-Deja-AN: 492208552 References: <7klja3$c0p$1@nnrp1.deja.com> <376E70A5.F77E558D@averstar.com> NNTP-Posting-Date: Mon, 21 Jun 1999 12:07:38 PDT Newsgroups: comp.lang.ada Date: 1999-06-21T00:00:00+00:00 List-Id: On 21 Jun 1999 17:04, Tucker Taft wrote: > To answer the question posed by this new question, the answer > given by Dale was correct, that private children provide "compilation > privacy." If you want to allow something to be "with"ed by public > children's specs, but contain content that is only visible to > the private part of the child's spec, the following idiom works: > > package Mostly_Private is > private > ... -- Declarations visible only in private part of other public > ... -- siblings > end Mostly_Private; > > That is, put the entire set of declarations in the private part > of a public child. I did what I think you wanted me to do, but got this error message: gcc -c -gnatc /home/matt/p-c2.ads p-c2.ads:9:23: "I1" is not a visible entity of "C1" Is this a compiler bug, or did I misunderstand what you said? Can a package really see the private part of its sibling? I thought that only your own children could see your private part. Or did you mean for me to put I1 in the private part of P, not P.C1? --STX package P is pragma Pure; end P; package P.C1 is private I1 : Integer; end P.C1; with P.C1; package P.C2 is I2 : Integer; private I3 : Integer := P.C1.I1; end P.C2;