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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,487310d7e1471eac X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!r29g2000hsg.googlegroups.com!not-for-mail From: eliben Newsgroups: comp.lang.ada Subject: Re: parent package referring to child Date: Wed, 10 Oct 2007 09:24:52 -0000 Organization: http://groups.google.com Message-ID: <1192008292.808925.227730@r29g2000hsg.googlegroups.com> References: <1191997397.865251.322480@d55g2000hsg.googlegroups.com> <1192007262.7362.69.camel@kartoffel> NNTP-Posting-Host: 194.90.39.105 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1192008293 13383 127.0.0.1 (10 Oct 2007 09:24:53 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 10 Oct 2007 09:24:53 +0000 (UTC) In-Reply-To: <1192007262.7362.69.camel@kartoffel> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) X-HTTP-Via: 1.0 RFINTISAPROXY01 Complaints-To: groups-abuse@google.com Injection-Info: r29g2000hsg.googlegroups.com; posting-host=194.90.39.105; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2404 Date: 2007-10-10T09:24:52+00:00 List-Id: On Oct 10, 11:07 am, Georg Bauhaus wrote: > On Tue, 2007-10-09 at 23:23 -0700, eliben wrote: > > Hello, > > > I have a package FOO that encapsulates a large part of the system. Now > > I need to add to it a public type (that should be visible by external > > code) with a lot of enumerated names (hundreds). I don't want to fill > > the spec of FOO with this huge type, so I thought it would be a good > > idea to create a subpackage: FOO.Names, and place the type there. > > However, declarations of subprograms in the spec of FOO must refer to > > the names from FOO.Names, and Ada 95 won't let me do that because it's > > parent referring to child. > > You can replicate the type as a derived type in FOO and create > the Names package as a normal package: > > type Twin is new Names.Huge; > True, but this would make Names and FOO seem unrelated, which they're not. It would be a shame. > Another possibility is to rearrange the package hierarchy so > that FOO can become a sibling of Names. > Why does it make sense that two siblings can see each other in their specs when they "with" each other, but a parent can't see a child ? Eli