Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site boulder.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!hao!nbires!boulder!geoff
From: geoff@boulder.UUCP (Geoffrey M. Clemm)
Newsgroups: net.lang.ada
Subject: Re: Implementing mutually dependent access types in separate packages
Message-ID: <394@boulder.UUCP>
Date: Fri, 9-Aug-85 14:07:09 EDT
Article-I.D.: boulder.394
Posted: Fri Aug  9 14:07:09 1985
Date-Received: Wed, 14-Aug-85 03:21:03 EDT
References: <383@boulder.UUCP> <2142@sdcrdcf.UUCP>
Reply-To: geoff@boulder.UUCP (Geoffrey Clemm)
Distribution: net
Organization: University of Colorado, Boulder
Lines: 47

A month ago I solicited suggestions on how to place the parts of a
mutually recursive set of data structures into different packages.  All
parts refer to other parts through access types, and therefore the various
record definitions should appear in the package bodies to avoid unnecessary
compilation dependencies.

In article <2142@sdcrdcf.UUCP> markb@sdcrdcf.UUCP (Mark Biggar) writes:
>You should have read section 3.8.1 more carefully.
(Mark, you should have read the posting more carefully, see below :-)
>
>[This section] says 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;
>
... same for B
>
>with B; use B;
>package body A is
>    type ATYPE is record
>	B: BTYPEPTR;
>    end record;
>end A;
... etc.
>
>Note that there is no cycle in the compilation order as the package specs
>can be compiled before any of the bodies.

From the original posting :
>Note:
>   If one was not required to provide accessing functions of the form
>   "ATYPE_BTYPE(ATYPEPTR) RETURN BTYPEPTR", there of
>   course would be no problem, but these accessing functions are critical.

Since I have only received two responses which both left out the critical
accessing functions, should I assume that it cannot be done properly in ADA ?

(Where "properly" is defined as 
   1. separate packages for each data structure that is a part of
      the mutually recursive set of data structures
   2. record implementations hidden inside the package bodies
)