comp.lang.ada
 help / color / mirror / Atom feed
From: "Pat Rogers" <progers@NOclasswideSPAM.com>
Subject: Re: (generic) child package of generic package; intantiation of
Date: Mon, 29 Jan 2001 11:25:14 -0600
Date: 2001-01-29T11:25:14-06:00	[thread overview]
Message-ID: <1Ihd6.38$cd1.2031@nnrp1.sbc.net> (raw)
In-Reply-To: LUgd6.9728$Qb7.1473404@newsb.telia.net

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1105 bytes --]

"Peter Hend�n" <phenden@tdab.com> wrote in message
news:LUgd6.9728$Qb7.1473404@newsb.telia.net...
> 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?

Imagine the declaration of the child generic is nested within an
*instantiation* of the parent unit, and use the instance name accordingly.
For example, if an instance of the Parent is Foo, as in:

    package Foo is new Parent;

we could say:

    package Bar is new Foo.RarelyUsedOps;

If you keep the visibility issues in mind (i.e. the child's view of the
parent's declarations) this approach will make more sense.

---
Patrick Rogers                       Consulting and Training in:
http://www.classwide.com        Real-Time/OO Languages
progers@classwide.com          Hard Deadline Schedulability Analysis
(281)648-3165                          Software Fault Tolerance





  parent reply	other threads:[~2001-01-29 17:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-29 16:30 (generic) child package of generic package; intantiation of Peter Hend�n
2001-01-29 17:20 ` Marc A. Criley
2001-01-29 17:24 ` mark.biggar
2001-01-29 17:25 ` Pat Rogers [this message]
2001-01-29 20:46   ` Peter Hend�n
2001-01-30 16:56     ` Tucker Taft
2001-01-30 21:33       ` Peter Hend�n
2001-01-30  4:48 ` Jeffrey Carter
2001-01-30 11:53   ` Peter Hend�n
  -- strict thread matches above, loose matches on Subject: below --
2001-01-31  5:34 Christoph Grein
replies disabled

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