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.5 required=5.0 tests=BAYES_00,MSGID_RANDY, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,2b4e4eade0270b85 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-29 09:30:19 PST Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!newshub2.rdc1.sfba.home.com!news.home.com!xfer10.netnews.com!netnews.com!news.maxwell.syr.edu!nntp2.deja.com!nnrp1.deja.com!not-for-mail From: mark.biggar@trustedsyslabs.com Newsgroups: comp.lang.ada Subject: Re: (generic) child package of generic package; intantiation of Date: Mon, 29 Jan 2001 17:24:24 GMT Organization: Deja.com Message-ID: <9548vr$32h$1@nnrp1.deja.com> References: NNTP-Posting-Host: 165.236.189.200 X-Article-Creation-Date: Mon Jan 29 17:24:24 2001 GMT X-Http-User-Agent: Mozilla/4.76 [en] (Win98; U) X-Http-Proxy: HTTP/1.1 sji-ca-cache[0A000001] (Traffic-Server/2.2 [uScMs f p eN:t cSMi p s ]), 1.0 x56.deja.com:80 (Squid/1.1.22) for client 165.236.189.200 X-MyDeja-Info: XMYDJUIDmark_biggar Xref: supernews.google.com comp.lang.ada:4664 Date: 2001-01-29T17:24:24+00:00 List-Id: In article , "Peter Hend�n" wrote: > I have the following: > > generic > Count : in Natural := 1; > package Parent is > ... > end Parent; > > generic > package Parent.RarelyUsedOps is > ... > end Parent.RarelyUsedOps; > > I have no problem instantiating Parent, of course, but how in the name of Ms > Lovelace do I instantiate the child package? with Parent; package p is new Parent; with P.RarelyUsedOps; package P.R is new P.RarelyUsedOps; When you instantiate a generic package that has generic children the newly created package automaticaly gets partialy instantiated generic children that correspond to the generic children of the original generic package. In a lot of way the children of a package work as if they were directly imbeded in the parent package. If you example instead was: generic Count : in Natural := 1; package Parent is ... generic package Parent.RarelyUsedOps is ... end Parent.RarelyUsedOps; ... end Parent; Then you could used a similar set of instantiations: with Parent; package P is new Parent; with P; package R is new P.RarelyUsedOps; Note that in both cases you instantiate a child/sub-package of the newly instantiated package not of the original generic parent package. -- Mark Biggar mark.biggar@trustedsyslabsl.com Sent via Deja.com http://www.deja.com/