comp.lang.ada
 help / color / mirror / Atom feed
From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: Generics and Child Packages
Date: Sat, 10 Aug 2013 02:25:55 -0700 (PDT)
Date: 2013-08-10T02:25:55-07:00	[thread overview]
Message-ID: <8c81cc18-bca4-43ac-aa9b-3ae9a670370c@googlegroups.com> (raw)
In-Reply-To: <d717e583-7238-439e-b60e-c3d0f2177640@googlegroups.com>

That's a very good question, and I had once the same problem.

The following is a short explanation of the ideas behind private packages:

package P is ... end P;
private package P.Q is ... end P.Q;

A client of P is meant not to be aware of the existence of P.Q. Now if you make P generic, P.Q becomes generic as well.

generic ... package P is ... end P;
private generic package P.Q is ... end P.Q;

So how could a client instantiating P then also instantiate P.Q if he is meant not to be aware of the existence? The only way a private generic package can be used is by instantiating it in a nonprivate child of P or the body of P.

This is the situation.

I see your problem: You have a hierarchy of packages and for some reason you have to make is generic. This is what I tried once - I do not remember how I solved the problem.

I guess a rule saying a private generic child package can only be instantiated as a private child could perhaps solve the problem. But I'm not aware of the full consequences of such a rule.


  reply	other threads:[~2013-08-10  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 20:35 Generics and Child Packages sbelmont700
2013-08-10  9:25 ` AdaMagica [this message]
2013-08-10 15:39 ` Felix Krause
2013-08-11 15:49 ` sbelmont700
2013-08-11 16:51   ` Robert A Duff
2013-08-11 18:30   ` AdaMagica
2013-08-11 19:20   ` Shark8
2013-08-12 20:27   ` Randy Brukardt
2013-08-12 21:58     ` Simon Wright
2013-08-12 20:19 ` Randy Brukardt
replies disabled

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