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.9 required=5.0 tests=BAYES_00 autolearn=ham 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!news1.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.germany.com!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: parent package referring to child From: Georg Bauhaus In-Reply-To: <1191997397.865251.322480@d55g2000hsg.googlegroups.com> References: <1191997397.865251.322480@d55g2000hsg.googlegroups.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1192007262.7362.69.camel@kartoffel> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Date: Wed, 10 Oct 2007 11:07:42 +0200 Organization: Arcor NNTP-Posting-Date: 10 Oct 2007 11:07:43 CEST NNTP-Posting-Host: 562b3d31.newsspool3.arcor-online.net X-Trace: DXC=2jnQ6cLJYMc[F<50eo:0knMcF=Q^Z^V3h4Fo<]lROoRa^;5]aA^R6>bUSa^hhA5AYj=kbmW`a1fGgC`2T@AUZfCk5i;_G>7]GKg X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:2403 Date: 2007-10-10T11:07:43+02:00 List-Id: 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; Another possibility is to rearrange the package hierarchy so that FOO can become a sibling of Names. (Sometimes I think a folding editor is a Good Thing, once I get used to it. The same with source navigation. :)