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.8 required=5.0 tests=BAYES_00,INVALID_DATE 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.3 4.3bsd-beta 6/6/85; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!su-sierra.arpa!BRYAN From: BRYAN@SU-SIERRA.ARPA (Doug Bryan) Newsgroups: net.lang.ada Subject: design problem/? Message-ID: <8509130608.AA02281@UCB-VAX.ARPA> Date: Fri, 13-Sep-85 02:08:44 EDT Article-I.D.: UCB-VAX.8509130608.AA02281 Posted: Fri Sep 13 02:08:44 1985 Date-Received: Sat, 14-Sep-85 05:38:18 EDT Sender: daemon@ucbvax.ARPA Organization: The ARPA Internet List-Id: Hello expert Ada designers, I could use your suggestions. This is the design problem: Consider a heavily layered system. One of the lower level packages exports a limited type. The higher levels are all abstractions of the operations avaiable at all lower levels. Thus higher level packages must reference the limited type and will export operations in this reference. The reference will be used in all parameter modes. The problem is, what type do the higher level packages use to reference the lower level limited type? For example: with text_io; package file_stuff is type a_file is limited private; procedure x (file : in out a_file); ... private type a_file somehow maps to text_io.file_type; end file_stuff; I have been using access types: type a_file is access text_io.file_type; This method has its limitations, for instance if the implementation of the limited type is an unconstrained record (all objects created using allocation are contrained). Another method involves arrays: private max_files : constant := 100; type a_file is range 1 .. max_files; ... package body file_stuff is the_files : array (a_file) of text_io.file_type; ... The limitations to the array solution are obvious: fixed max number of objects, lots of memory used when it may not need be ( of the user only needs 2 files).... what do you think?? doug -------