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,c0d427d5f4af20f8 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "REH" Newsgroups: comp.lang.ada Subject: Re: generics in Ada 83 Date: 13 Sep 2005 12:53:56 -0700 Organization: http://groups.google.com Message-ID: <1126641236.861060.94150@f14g2000cwb.googlegroups.com> References: <1126617980.932226.320710@g43g2000cwa.googlegroups.com> <4326d73a$1_1@glkas0286.greenlnk.net> <1126629046.328151.40970@g47g2000cwa.googlegroups.com> <1126636985.067939.27760@f14g2000cwb.googlegroups.com> <87r7bshi8i.fsf@ludovic-brenta.org> NNTP-Posting-Host: 192.35.35.35 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1126641242 3989 127.0.0.1 (13 Sep 2005 19:54:02 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 13 Sep 2005 19:54:02 +0000 (UTC) In-Reply-To: <87r7bshi8i.fsf@ludovic-brenta.org> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=192.35.35.35; posting-account=lnUIyw0AAACoRB2fMF2SFTIilm8F10q2 Xref: g2news1.google.com comp.lang.ada:4629 Date: 2005-09-13T12:53:56-07:00 List-Id: Ludovic Brenta wrote: > "REH" writes: > > Martin Dowie wrote: > >> package A is > >> type A_T is private; > >> procedure Y (Z : A_T); > >> private > >> type A_T is new Integer; > >> end A; > >> > >> generic > >> type X is private; > >> with procedure Y (Z : X) is <>; > >> package B is > >> end B; > >> > >> with A; use A; > >> with B; > >> > >> package C is > >> new B (A_T); -- Picks up 'Y' by default > >> > >> Cheers > >> > >> -- Martin > > > > That seems reasonable. Two questions: > > 1) If I have Y1 through Yn, Do I define the ones I care about when I > > instantiate B or do I define then in C, before B? > > If there are several Y's to choose from, you must choose at the point > of instantiation of B: > > with A, B; > package C is new B (X => A.A_T, Y => A.Yn); > I'm sorry. I was not clear. I meant several Y's to define, but I only want to define some. My understanding is I need to instantiate the ones I care about in C, and the rest will receive the stubs from A. Is that correct? with A, B, D; package C is new B (X => A.A_T, Y1 => D.Y1, Y3 => D.Y3); So, if I define things correctly, Y2 will default to A.Y2?