comp.lang.ada
 help / color / mirror / Atom feed
From: Alastair Brady <alastair.brady@rol3.com>
Subject: Re: recursive with
Date: 1998/09/30
Date: 1998-09-30T00:00:00+00:00	[thread overview]
Message-ID: <361272E7.662A074@rol3.com> (raw)
In-Reply-To: 36126018.7619@teisa.unican.es

David Pando wrote:

> I've got an object defined in a package A with a atribute that points to
> an object defined in a package B, but this object has an atribute that
> points to the first objetc (Do I make myself clear?)
> The problem is than I can't compile the packages, because package A
> needs packege B that needs package A that...
> Is there any solution, apart from defining the objects in the same
> package

Cyclic with's are forbidden in Ada as they prevent type checking.  Its not
clear what sort of objects you are referring to... functions/procedures,
data or types.

For functions and procdures, if you need to make a call back to the package
which you have been called from, then logically either the current operation
of the operation you wish to call exists in the wrong package.  Either they
should all exist in the same package (if they are strongly related) or all
exist in separate packages.

For types, it is common to declare a global 'types' package for types which
are common to multiple areas of the system, which is basically just a
package spec which is compiled first, and can then be with'ed by all other
packages.  Similarly this can be done for global data, but strictly speaking
all data should be encapsulated and accessed using access functions
  ------------------------------------------------------------------------
Alastair Brady, Software Consultant,






  reply	other threads:[~1998-09-30  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-30  0:00 recursive with David Pando
1998-09-30  0:00 ` Alastair Brady [this message]
1998-10-01  0:00   ` David Pando
1998-10-02  0:00   ` Robert I. Eachus
replies disabled

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