From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4bdb89c75985fc92 X-Google-Attributes: gid103376,public From: Alastair Brady Subject: Re: recursive with Date: 1998/09/30 Message-ID: <361272E7.662A074@rol3.com>#1/1 X-Deja-AN: 396392805 Content-Transfer-Encoding: 7bit References: <36126018.7619@teisa.unican.es> Content-Type: text/plain; charset=us-ascii X-Complaints-To: news@ubnnews.unisource.ch X-Trace: ubnnews.unisource.ch 907175165 12388 (None) 195.65.20.19 Organization: Unisource Business Networks (post doesn't reflect views of Unisource) Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-09-30T00:00:00+00:00 List-Id: 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,