comp.lang.ada
 help / color / mirror / Atom feed
* cross linking packages
@ 1994-11-28 12:56 Rene Burema
  1994-11-29 18:28 ` Norman H. Cohen
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Rene Burema @ 1994-11-28 12:56 UTC (permalink / raw)


Dear netlanders,

I have a problem specifing a seemingly simple problem in Ada. Anybody
want to help?

The problem is as follows:

-------------------- package A -----------------------
package A;
type tA is private;
procedure giveB(x: in tA,y: out tB);
end A;
-------------------- package B -----------------------
package B;
type tB is private;
procedure giveA(x: in tB,y: out tA);
end B;
---------------
where tA could be a reference to a  Doctor giving the reference to
a Patient (tB) and vice versa.

I need a with statement for B and A respectively. The Ada gnat compiler
however stumbles into a circular dependency. How can I solve this without
placing the two types tA and tB in a single package.

Many thanks for any help

	Arjen Duursma (arjen@capints.uucp)

PS: don't use the return adress in the message, as it is a shared account.



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: cross linking packages
@ 1994-12-06 16:34 Bob Wells #402
  0 siblings, 0 replies; 11+ messages in thread
From: Bob Wells #402 @ 1994-12-06 16:34 UTC (permalink / raw)


Robert Dewar <dewar@CS.NYU.EDU> writes

> Matt a brief answer to your question is that order of elaboration of
> types is critical, and in particular if package a with's package b,
> it is essential that the spec of b be elaborated before the spec of a.
> Remember that elaboration of types in Ada can have all sorts of side
> effects.

Not to mention the obvious extension of this where the body of b must be
elaborated before the spec of a if the spec of a contains declarations of
initialised variables or constants whose values are set by functions
declared in the spec of b. I guess this would also be try for named
numbers aswell.

Bob W.



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

end of thread, other threads:[~1994-12-06 16:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-11-28 12:56 cross linking packages Rene Burema
1994-11-29 18:28 ` Norman H. Cohen
1994-11-29 22:07 ` Robert Dewar
1994-11-30 16:33   ` David Weller
1994-12-01 13:44     ` Robert I. Eachus
1994-11-30 23:03   ` Matt Kennel
1994-12-02 14:30     ` Norman H. Cohen
1994-12-05 20:57     ` Elaboration order [was: cross linking packages] John Volan
1994-12-06 16:11       ` Robert Dewar
1994-12-05 13:30 ` cross linking packages John Volan
  -- strict thread matches above, loose matches on Subject: below --
1994-12-06 16:34 Bob Wells #402

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