comp.lang.ada
 help / color / mirror / Atom feed
From: "REH" <spamjunk@stny.rr.com>
Subject: Re: generics in Ada 83
Date: 13 Sep 2005 12:53:56 -0700
Date: 2005-09-13T12:53:56-07:00	[thread overview]
Message-ID: <1126641236.861060.94150@f14g2000cwb.googlegroups.com> (raw)
In-Reply-To: <87r7bshi8i.fsf@ludovic-brenta.org>


Ludovic Brenta wrote:
> "REH" <spamjunk@stny.rr.com> 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?




  reply	other threads:[~2005-09-13 19:53 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 13:26 generics in Ada 83 REH
2005-09-13 13:30 ` Georg Bauhaus
2005-09-13 16:25   ` REH
2005-09-13 19:23     ` Georg Bauhaus
2005-09-13 13:50 ` Martin Dowie
2005-09-13 16:30   ` REH
2005-09-13 16:41     ` Martin Dowie
2005-09-13 18:43       ` REH
2005-09-13 19:37         ` Ludovic Brenta
2005-09-13 19:53           ` REH [this message]
2005-09-13 16:56 ` Jeffrey Carter
2005-09-13 18:53   ` REH
2005-09-13 22:16     ` Jeffrey Carter
2005-09-13 22:44       ` REH
2005-09-14  8:14   ` Jean-Pierre Rosen
2005-09-14 12:40     ` REH
2005-09-14 13:15     ` Hyman Rosen
2005-09-14 14:08       ` Jean-Pierre Rosen
2005-09-14 15:23         ` Hyman Rosen
2005-09-14 15:41           ` Robert A Duff
2005-09-19 17:58             ` REH
2005-09-20  4:58               ` Hyman Rosen
2005-09-20 12:36                 ` REH
2005-09-20  1:34             ` adaworks
2005-09-20  4:14               ` Jim Rogers
2005-09-21 22:58               ` Robert A Duff
2005-09-22 15:18                 ` adaworks
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox