comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: pb with child units
Date: Fri, 23 Feb 2001 14:43:05 GMT
Date: 2001-02-23T14:43:05+00:00	[thread overview]
Message-ID: <ZFul6.633$aw5.1036@www.newsranger.com> (raw)
In-Reply-To: 3A966E4D.778BE01E@irit.fr

In article <3A966E4D.778BE01E@irit.fr>, Veronique GAILDRAT says...
>
>I try to call a subprogram from a brother unit :
>generic
>package liste_dyn_gen_p.liste_simple_p is
>	procedure insererEnTete (le : in out Liste; i : Item);
..
>with liste_dyn_gen_p.liste_simple_p;
>
>package body liste_dyn_gen_p.liste_dyn_triee_p is
>	procedure inserer (le : in out Liste; e : Item) is
>	begin
>----> error ---->	liste_dyn_gen_p.liste_simple_p.insererEnTete(le, e);
>	invalid prefix in selected component "liste_simple_p"
>
>but liste_simple_p is a child unit of liste_dyn_gen_p !

No, its not. Its a child unit of an *instantiation* of liste_dyn_gen_p. You
can't make a call to a generic, only to an *instantiation* of one. You could
make an instantiation of liste_simple_p in the body of liste_dyn_triee_p, but
that's probably not what you want because that instantiation would be different
than any others you might have outside of liste_dyn_triee_p. If you want access
to a routine in a *particular* instantiation of a generic package that is not
your package's ancestor, you will have to have it (the routine or the package)
supplied as a generic parameter to your package.





---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



      reply	other threads:[~2001-02-23 14:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-23 14:06 pb with child units Veronique GAILDRAT
2001-02-23 14:43 ` Ted Dennison [this message]
replies disabled

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