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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4d972ac0c79198a5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-16 16:44:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed.hanau.net!news-fra1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Generic child units Date: Fri, 16 May 2003 23:44:11 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <3ec12f93$1@epflnews.epfl.ch> <3ec1f6ab$1@epflnews.epfl.ch> NNTP-Posting-Host: d2-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1053128651 26492 134.91.1.15 (16 May 2003 23:44:11 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Fri, 16 May 2003 23:44:11 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/831)) Xref: archiver1.google.com comp.lang.ada:37415 Date: 2003-05-16T23:44:11+00:00 List-Id: Robert A Duff wrote: : Rodrigo Garc?a writes: : :> Stephen Leake wrote: :> > Rodrigo Garc?a writes: :> > :> >>I need some enlightment in this area... Let us suppose that I have two :> >>generic packages declared in separate files and one is the parent of :> >>the other: :> >> :> >>generic :> >> type Elem is private; :> >>package Parent is :> >> type Vector is array (Integer range <>) of Elem; :> >>end Parent; :> >> :> >>generic :> >>package Parent.Child is :> >> subtype Vector2D is Vector (1 .. 2); :> >>end Parent.Child; :> >> :> >> How can I instantiate the child package :> >>within the declarative region of the parent package (as required by :> >>RM 10.1[.1](18))? Am I right that this is supposed to mean, for example, with Parent.Child; package body Parent package Inst is new Parent.Child; end Parent; because the body is part of the declarative region of P, and there is no circular dependency? (So the instance is *inside* the parent generic?) : Paragraph 19.b in the AARM explains it. You are instantiating the child : *outside* the parent generic, so you want to instantiate the child of : the instance of the parent, not the child of the parent. Make sense? -- Georg