Version 1.1 of acs/ac-00033.txt

Unformatted version of acs/ac-00033.txt version 1.1
Other versions for file acs/ac-00033.txt

!standard 10.1.1(1)          02-05-03 AC95-00033/01
!class amendment 02-05-03
!status received no action 02-05-03
!subject Child packages of nested packages

!topic : Child packages of nested packages
!reference :  RM95-10.1.1(1)
!from : Oliver Kellogg 02-04-25
!keywords : nested package, child package, parent unit
!discussion :

For Ada0Y I propose to permit child packages not only for library
level packages, but also for packages nested in library level

This would provide for better integration between nested packages
and child packages. The two constructs currently exist side by side
without the possibility of mixing them.

A motivation for using nested packages instead of child packages
is when the library level package depends on declarations in its
subsidiary packages. Child packages are not suitable for the
subsidiary packages as the parent package may not "with" its own
child packages.

Nevertheless it should be possible to extend any of these
interdependent packages using child packages.

A specific case where it is necessary to extend only a nested
package via a child package is the CORBA IDL to Ada mapping.

module Outer {

   interface Inner {
      typedef short inner_t;
      void mymethod ();

   typedef Inner::inner_t outer_t;

Here the interface Inner must inevitably be mapped to a nested
package as a later declaration in package Outer depends on a
declaration from Inner.

However, the interface Inner also requires an implementation.
According to the current IDL to Ada mapping, this implementation
should be hosted in a child package, Outer.Inner.Impl. This child
package is human written while the code for Outer (and thus Inner)
is generated by an IDL to Ada translator.

Further, according to CORBA it is possible to bind a main program
as a pure proxy (client), i.e. without the Outer.Inner.Impl child
package. Outer.Inner must therefore not depend on the existence of

Visibility: A child package should have visibility of the private
parts of its ancestors, be they child packages or nested packages.

Questions? Ask the ACAA Technical Agent