comp.lang.ada
 help / color / mirror / Atom feed
From: mbk@inls1.ucsd.edu (Matt Kennel)
Subject: Re: cross linking packages
Date: 30 Nov 1994 23:03:23 GMT
Date: 1994-11-30T23:03:23+00:00	[thread overview]
Message-ID: <3bj0br$mri@network.ucsd.edu> (raw)
In-Reply-To: 3bg8mp$i0g@gnat.cs.nyu.edu

Robert Dewar (dewar@cs.nyu.edu) wrote:
: "The GNAT compiler stumbles into a circular ..."

: How about instead

: "The GNAT compiler correctly diagnoses an illegal circular dependency"

: This is definitely wrong, you have to put both types in the same
: package if they have this sort of mutual dependence. 

: (and now we can rerun the long dialog on mutually recursive types :-)

Can somebody answer this question:

  Why were cyclical dependencies among types defined illegal?

(I.e. type A defines features that use type B, and type B defines
 features that use type A.)

After all in a statically typed langauge like Ada, all variables
must be bound to types statically at compile time, so there
should be no ambiguity in "elaboration order" as there is no
run-time execution that must take place to bind variables
to types.

It apparently works fine when they are in the same package. 
Thus supposing you put two types each in their own package, both inside
an outer package.

Do the mutual dependencies now work fine because they are both inside
one package, the outer one?

--
-Matt Kennel  		mbk@inls1.ucsd.edu
-Institute for Nonlinear Science, University of California, San Diego
-*** AD: Archive for nonlinear dynamics papers & programs: FTP to
-***     lyapunov.ucsd.edu, username "anonymous".



  parent reply	other threads:[~1994-11-30 23:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
replies disabled

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