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

Alastair Brady wrote:
> 
> 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,


Do you mean C-style ?
The problem is that the package were generated by CADRE, a tool that
builts ADA packages from OMT graphs. Every class is encapsulated in a
package named with the name of the class, and the objects of that class
are of the type Instance. For example, the class foo is in the package
foo, an the object is the type foo.Instance, so I can't encapsulate the
related objects in the same package because the names overlap.




  reply	other threads:[~1998-10-01  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
1998-10-01  0:00   ` David Pando [this message]
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