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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8bc57ad5ed1a513e X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: Elaboration circularity Date: 2000/02/02 Message-ID: <389858D0.32A39FFC@earthlink.net>#1/1 X-Deja-AN: 580891322 Content-Transfer-Encoding: 7bit References: <949502026.152029@edh3> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-ELN-Date: Wed Feb 2 10:19:33 2000 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 949515573 63.11.145.36 (Wed, 02 Feb 2000 10:19:33 PST) Organization: EarthLink Network, Inc. MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Wed, 02 Feb 2000 10:19:33 PST Newsgroups: comp.lang.ada Date: 2000-02-02T00:00:00+00:00 List-Id: I've encountered similar problems with legacy code. I eliminated the circularity using a child package. I don't know if it will work for you, but here's how it worked for me: There are 2 packages, A and B. The spec of A has some type declarations and some operations. The spec of B has "with A;" and references the type declarations in A. The body of B also references the type declarations in A. The body of A has "with B;", "pragma Elaborate (B);" (this was Ada-83 legacy code), and calls the operations of B during elaboration. Thus B has to be elaborated before A. Hence the circularity: The body of each package depends on the spec of the other. I moved the operations of A, including the elaboration that calls B, into a child package, A.Operations. This allows B to "with A;" and the body of A.Operations to "with B;" without a circularity. The unit which called the operations in A had to also be modified to "with A.Operations;". HTH. -- Jeff Carter "You empty-headed animal-food-trough wiper." Monty Python & the Holy Grail