comp.lang.ada
 help / color / mirror / Atom feed
* Strongly coupled generic children?
@ 1996-04-23  0:00 Joerg Rodemann
  1996-04-23  0:00 ` Michel Gauthier
  1996-04-24  0:00 ` Pascal Ledru
  0 siblings, 2 replies; 3+ messages in thread
From: Joerg Rodemann @ 1996-04-23  0:00 UTC (permalink / raw)


Hi folks!

Playing around with generics I stumbled over the following problem:

   1.) I have a generic library unit x providing some key data of my problem
       Generic parameter: e.g. floating point type

       generic
          type Floating is digits <>;
       package x is
       ...
       end x;

   2.) Added to this is a child package x.y which provides some tables
       used just for a small number of modules (This is different for x).

       generic
       package x.y is
       ...
          procedure SomeWhat;
       ...
       end x.y;
   3.) Now I want to add another child unit x.z that provides some further
       information. This module needs access to the data contained in x.y
       but I do not want to put it into x.y because x.z may be exchanged
       by some other package (that possibly also uses x.y).
       Is there some way to do something like the following?

       with x.y;
       generic
       package x.z is
       ...
          procedure DoSomething;
       ...
       end x.z;

       package body x.z is
       ...
          procedure DoSomething is
          begin
             ...
             x.y.SomeWhat;
             ...
          end DoSomething;
       ...
       end x.z;

Is it possible in Ada-95 to build up such a library structure? Or do I
have to deliver an instantiation of x.y as a generic parameter to x.z in
its instantiation?

Any help appreciated

Thanks

George




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-04-24  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-04-23  0:00 Strongly coupled generic children? Joerg Rodemann
1996-04-23  0:00 ` Michel Gauthier
1996-04-24  0:00 ` Pascal Ledru

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