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.1 required=5.0 tests=BAYES_00, 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-30 13:33:51 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!news.tele.dk!212.37.1.10!newsfeed01.se.dataphone.net!nntp.se.dataphone.net!news.powertech.no!nntp.newmedia.no!newsfeed1.enitel.no!masternews.telia.net!newsb.telia.net.POSTED!not-for-mail From: "Peter Hend�n" Newsgroups: comp.lang.ada References: <1Ihd6.38$cd1.2031@nnrp1.sbc.net> <3A76F223.B0D07EB7@averstar.com> Subject: Re: (generic) child package of generic package; intantiation of X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: <2rGd6.10303$Qb7.1527248@newsb.telia.net> Date: Tue, 30 Jan 2001 21:33:50 GMT NNTP-Posting-Host: 213.64.235.46 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 980890430 213.64.235.46 (Tue, 30 Jan 2001 22:33:50 CET) NNTP-Posting-Date: Tue, 30 Jan 2001 22:33:50 CET Organization: Telia Internet Xref: supernews.google.com comp.lang.ada:4729 Date: 2001-01-30T21:33:50+00:00 List-Id: "Tucker Taft" wrote: > Unfortunately, Mark, Marc, and Pat all forgot to mention that you > have to "with" the child unit where you plan to instantiate it. > The way to think about a "with" clause for a child is that it effectively > inserts the child into the parent. With a child of a generic, > inserting the child into the generic parent means that all instances > of the generic parent now include the generic child nested within > them. You can then instantiate one of those nested generics, > given any instance of the parent. What I wound up with was (using gnat 3.13p): --- GenParent.ads generic ... package GenParent is ... end GenParent; --- GenParent-GenChild.ads generic package GenParent.GenChild is ... end GenParent.GenChild; --- InstantiatedParent.ads with GenParent; package InstantiatedParent is new GenParent(...); --- InstantiatedParent - InstantiatedChild.ads with GenParent.GenChild; -- have to with the generic child package (1) package InstantiatedParent.InstantiatedChild is new InstantiatedParent.GenChild; ---- (1) Is this what you meant? Is the above the way to do it? Any better ways? > But the key thing to remember is that the nested generic is only > made visible where a "with" clause for the generic child applies. Grateful for any and all help. Regards, Peter -- Peter Hend�n http://www.algonet.se/~phenden ICQ: 14672398 Teknisk Dokumentation AB http://www.tdab.com