comp.lang.ada
 help / color / mirror / Atom feed
* decomposing large packages
@ 2020-01-08 15:56 mario.blunk.gplus
  2020-01-08 16:36 ` Dmitry A. Kazakov
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: mario.blunk.gplus @ 2020-01-08 15:56 UTC (permalink / raw)


Hello,
I have a package P (spec and body) which is becoming greater and greater as more functionality is implemented. Is there a way to decompose the package into smaller packages S1, S2, etc ? I'm thinking of a kind of "include" directive that refers to the files where stuff has been moved. Example:

The package P in the current state contains:

package P is
 type thing is ...
 procedure m (value : in thing);
 procedure n (value : in thing; temp : in natural);
end package P;

package body P is:
 procedure m (value : in thing) is ...
 procedure n (value : in thing; temp : in natural) is ...
end package body P;

From inside package P the procedure n can be called which is fine so far.
Now I want to take out procedure n and move it into package S1:

package S1 is
 procedure n (value : in thing; temp : in natural);
end package S1;

package body S1 is:
 procedure n (value : in thing; temp : in natural) is ...
end package body S1;

Now procedure n must be visible from inside package P. How can I accomplish that ? I played with child units but did not get what I wanted. The parent P unit must see the procedures and functions of the child units P.S1, P.S2, ... but the compiler complains that procedure n is not defined for type thing in P.
Thanks for your help in advance.




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

end of thread, other threads:[~2020-01-10 20:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-08 15:56 decomposing large packages mario.blunk.gplus
2020-01-08 16:36 ` Dmitry A. Kazakov
2020-01-09  8:25   ` mario.blunk.gplus
2020-01-09  8:58     ` Dmitry A. Kazakov
2020-01-09 18:24       ` G. B.
2020-01-10 20:03         ` mario.blunk.gplus
2020-01-08 16:45 ` Simon Wright
2020-01-09  8:28   ` mario.blunk.gplus
2020-01-09 17:43     ` Simon Wright
2020-01-10 20:00       ` mario.blunk.gplus
2020-01-08 21:41 ` Shark8

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