comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Generics and Child Packages
Date: Sun, 11 Aug 2013 12:51:48 -0400
Date: 2013-08-11T12:51:48-04:00	[thread overview]
Message-ID: <wcck3js9nmj.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 79ec97f1-b5f8-4b12-b351-262fad685f50@googlegroups.com

sbelmont700@gmail.com writes:

> Though I still don't buy the "children of a generic are a generic"
> explanation.  Semantically there is no difference between a nested
> package and a child package, ...

That ought to be the case, but it's not.  There are lots of
other cases, besides this child-generic thing.  Why is this
legal:

with Ada.Containers.Vectors; use Ada;
package P is
   type T is private;
private
   type T is (Red);
end P;

package P.Q is
   package T_Vectors is new Containers.Vectors
     (Index_Type => Positive, Element_Type => T);
end P.Q;

but this is illegal:

with Ada.Containers.Vectors; use Ada;
package P is
   type T is private;

   package Q is
      package T_Vectors is new Containers.Vectors
        (Index_Type => Positive, Element_Type => T);
   end Q;
private
   type T is (Red);
end P;

For that matter, why should the following be illegal:

package P is
   with Something;
   package Q is
   end Q;
end P;

- Bob

  reply	other threads:[~2013-08-11 16:51 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
2013-08-10 15:39 ` Felix Krause
2013-08-11 15:49 ` sbelmont700
2013-08-11 16:51   ` Robert A Duff [this message]
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