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,775bc4aee028e5e9,start X-Google-Attributes: gid103376,public From: cpallen@nospam.com (Craig Allen) Subject: Q's: nested packages / visibilty Date: 1998/11/19 Message-ID: <9v6hGdgMLuwN-pn2-VFf4e0fMp6MD@dt182n2f.tampabay.rr.com>#1/1 X-Deja-AN: 413400465 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="us-ascii" X-Complaints-To: abuse@tampabay.rr.com X-Trace: newse2.tampabay.rr.com 911451994 24.92.210.47 (Thu, 19 Nov 1998 00:06:34 EDT) MIME-Version: 1.0 NNTP-Posting-Date: Thu, 19 Nov 1998 00:06:34 EDT Newsgroups: comp.lang.ada Date: 1998-11-19T00:00:00+00:00 List-Id: Hello again. First of all, I would like to preface my question with the fact that I'm using Ada83, so please tailor any responses accordingly. I have questions concerning nested packages. 1st question: I want to take a package and divide it up into several pieces. As I understand it, there are 2 ways to do this. 1 way places the specifacation (declaration?) for the nested package inside the specification for the parent package. This causes the contents of the sub-package to be available to any unit referencing the parent package. The other places the spec for the nested package inside the declarative part of the body of the parent package. In this way, only the parent is allowed to use the procedures in the sub-package. What I'm wondering is this: Is there a way to have a sub-package that has some of its procedures visible only to the parent package, and others that are visible to external units? (Where does the spec go?) I thought about using 'private' to do this, but that seems to apply to data types. Could it also apply to procedures? 2nd related question: When I make a sub-package that will be used only by the parent package, The sub package body & spec both appear in the declarative part of the parent package. Now I see I can use 'separate' to move the body to another (compilation unit) - this cleans the code up quite a bit and is exactly what I'm looking for. Can I not also do something about the specification for this sub-package? Right now it is still sitting in the parent package. I would like to move it to it's own separate file as well, and somehow just include it in the parent, but I don't think you can put a 'with' there, and if I try to put the with for this file at the top of the parent package, it doesn't work. Isn't there a way for me to clean this up further by moving this (possibly lengthy) package specification elsewhere? Thanks in advance for any help. -Craig