From: john@assen.demon.co.uk (John McCabe)
Subject: Re: Ada equivalent of C "static" structures
Date: 1997/03/09
Date: 1997-03-09T00:00:00+00:00 [thread overview]
Message-ID: <33233253.43078446@news.demon.co.uk> (raw)
In-Reply-To: dewar.857857727@merv
dewar@merv.cs.nyu.edu (Robert Dewar) wrote:
>John suggests
>
><<My advice would be to define a separate package with the type or
>object definition you require, and only "with" it in a single file
>e.g:
>
>*file1*
>package data_package is
> type x is record
> :
> :
> end record;
>
> x_value : x;
>end data_package;
>
>*file2*
>with data_package;
>package body p_1 is
> :
> :
>end p_1;
>
>>>
>
>Robert replies
>
>If data_package is only going to be with'ed from p_1, then make it a
>private child of p_1, but far simpler, as suggested by several replies,
>already, is just to define x_value within the body of p_1. I am not
>sure why John is suggesting a separate package here, it seems entirely
>unnecessary.
>
You're quite right. I missed out the "with" for p_2 i.e.:
*file2*
with data_package;
package body p_1 is
:
:
end p_1;
with data_package; -- Originally missed this out!
package body p_2 is
:
:
end p_2;
Best Regards
John McCabe <john@assen.demon.co.uk>
prev parent reply other threads:[~1997-03-09 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-03-07 0:00 Ada equivalent of C "static" structures Michael Ibarra
1997-03-07 0:00 ` Robert Dewar
1997-03-07 0:00 ` john schneider
1997-03-08 0:00 ` John McCabe
1997-03-08 0:00 ` Robert Dewar
1997-03-09 0:00 ` John McCabe [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox