comp.lang.ada
 help / color / mirror / Atom feed
From: cpallen@nospam.com (Craig Allen)
Subject: Q's: nested packages / visibilty
Date: 1998/11/19
Date: 1998-11-19T00:00:00+00:00	[thread overview]
Message-ID: <9v6hGdgMLuwN-pn2-VFf4e0fMp6MD@dt182n2f.tampabay.rr.com> (raw)

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




             reply	other threads:[~1998-11-19  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-19  0:00 Craig Allen [this message]
1998-11-19  0:00 ` Q's: nested packages / visibilty Matthew Heaney
1998-11-19  0:00   ` Ed Falis
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox