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=2.7 required=5.0 tests=BAYES_05,FROM_DOMAIN_NOVOWEL, INVALID_DATE,MSGID_SHORT,REPLYTO_WITHOUT_TO_CC,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sdcrdcf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!oliveb!hplabs!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: net.lang.ada Subject: Re: Implementing mutually dependent access types in separate packages Message-ID: <2142@sdcrdcf.UUCP> Date: Thu, 11-Jul-85 13:52:19 EDT Article-I.D.: sdcrdcf.2142 Posted: Thu Jul 11 13:52:19 1985 Date-Received: Wed, 17-Jul-85 04:41:13 EDT References: <383@boulder.UUCP> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Distribution: net Organization: System Development Corp. R+D, Santa Monica Summary: List-Id: You should have read section 3.8.1 more carefully. If the incomplete type declaration occurs immediately within the private part of a package, then the full type declaration must occur later and immediately within either the private part itself, OR THE DECLARATIVE PART OF THE CORRESPONDING PACKAGE BODY. (3.8.1 para 3, last sentence) This means that you can do what you want using something similar to the following: package A is type ATYPEPTR is private; private type ATYPE; type ATYPEPTR is access ATYPE; end A; package B is type BTYPEPTR is private; private type BTYPE; type BTYPEPTR is access BTYPE; end B; package C is type CTYPEPTR is private; private type CTYPE; type CTYPEPTR is access CTYPE; end C; with C; use C; package body A is type ATYPE is record C: CTYPEPTR; end record; end A; with A; use A; package body B is type BTYPE is record A: ATYPEPTR; end record; end B; with B; use B; package body C is type CTYPE is record B: BTYPEPTR; end record; end C; Note that there is no cycle in the compilation order as the package specs can be compiled before any of the bodies. Happy Ada hacking Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb