comp.lang.ada
 help / color / mirror / Atom feed
* Can't hide parts of ADTs in private children
@ 1998-11-09  0:00 David Bowerman
  1998-11-09  0:00 ` Stephen Leake
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Bowerman @ 1998-11-09  0:00 UTC (permalink / raw)


I am implementing an Abstract Data Type (Class) in a package.  The code
goes something like this:

  package Class_X_Package is

    type Class_X is private;
    type Class_X_Ptr is access Class_X;

    ...  operations on objects of type X

  private

    type Class_X is
      record
        Component_A : Type_A;
        Component_B : Type_B;
        ...
      end record;

  end Class_X_Package;

The abstract data type (X) is complex, and Type_A, Type_B, etc hide a
lot of structure within themselves.
I would like to break the package down further, declare the types, and
generally hide the details of, Type_A, Type_B, etc (never intended to be
visible to the client) in private child packages.
But I can't do this because these types are referred to in the private
part of the parent package spec, and this isn't allowed to 'with' its
children.

Can anyone suggest another way of doing it.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-11-16  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-09  0:00 Can't hide parts of ADTs in private children David Bowerman
1998-11-09  0:00 ` Stephen Leake
1998-11-10  0:00 ` Dale Stanbrough
1998-11-16  0:00 ` Matthew Heaney

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