comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: pointers & OOP
Date: 1999/05/14
Date: 1999-05-14T00:00:00+00:00	[thread overview]
Message-ID: <m3zp37pq04.fsf@mheaney.ni.net> (raw)
In-Reply-To: 3731d200.1993345@news.pacbell.net

tmoran@bix.com (Tom Moran) writes:

> Suppose you have
>   type Root is abstract tagged ...
>   procedure Very_General(X : in out Root);
> private
>   procedure Internal_Updating(X : in out Root'class);
> and then Root has a son and a daughter
>   type Son is new Root with ...
> and 
>   type Daughter is new Root with ...
> and suppose that Son and Daughter need to use Root's Internal_Updating
> procedure.  If they are both declared in the same package as Root, no
> problem.  Even if they are declared in child packages of Root, no
> problem.  But if they are declared in truly separate packages, then
> either they cannot see Internal_Updating, or else you move
> Internal_Updating to the public part of Root's package, thus letting
> anybody see and call Internal_Updating.
>    How would you propose structuring this if you are required to have
> 1-1 package/class?

Son and Daughter go in (public) child packages.  A child has visibility
to the private part of its parent.

package Family is

  type Root is ..

private

  procedure Internal_Update ...;

end;

package Family.Sons is

  type Son is new Root with ...;

  ...

end Family.Sons;

package Family.Daughters is

 type Daughter is new Root with ...;

end Family.Daughters;






  parent reply	other threads:[~1999-05-14  0:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-01  0:00 pointers & OOP Matthew Heaney
1999-05-01  0:00 ` Matthew Heaney
1999-05-03  0:00 ` John Robinson
1999-05-03  0:00   ` Samuel Mize
1999-05-04  0:00     ` Robert Dewar
1999-05-04  0:00     ` Martin C. Carlisle
1999-05-04  0:00   ` Robert Dewar
1999-05-04  0:00     ` Mike Silva
1999-05-05  0:00     ` John Robinson
1999-05-05  0:00       ` Robert Dewar
1999-05-05  0:00         ` John Robinson
1999-05-06  0:00           ` Brian Rogoff
1999-05-07  0:00             ` dennison
1999-05-07  0:00               ` Brian Rogoff
1999-05-10  0:00                 ` dennison
1999-05-11  0:00                   ` Jean-Pierre Rosen
1999-05-11  0:00                     ` dennison
1999-05-10  0:00             ` John Robinson
1999-05-14  0:00               ` Matthew Heaney
1999-05-14  0:00                 ` David Botton
1999-05-14  0:00           ` Matthew Heaney
1999-05-14  0:00             ` Ed Falis
1999-05-05  0:00       ` Matthew Heaney
1999-05-05  0:00       ` Robert Dewar
1999-05-08  0:00         ` Ehud Lamm
1999-05-06  0:00       ` Tom Moran
1999-05-06  0:00         ` John Robinson
1999-05-06  0:00           ` Tom Moran
1999-05-07  0:00             ` dennison
1999-05-07  0:00             ` dennison
1999-05-07  0:00             ` dennison
1999-05-10  0:00             ` John Robinson
1999-05-14  0:00         ` Matthew Heaney [this message]
1999-05-06  0:00       ` Simon Wright
1999-05-06  0:00         ` John Robinson
1999-05-08  0:00           ` Simon Wright
1999-05-10  0:00             ` John Robinson
1999-05-05  0:00     ` Francois Godme
  -- strict thread matches above, loose matches on Subject: below --
1999-05-01  0:00 Tom Moran
replies disabled

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