comp.lang.ada
 help / color / mirror / Atom feed
* Visible or hidden derivation for controlled types ?
@ 1997-03-14  0:00 Mats Weber
  1997-03-15  0:00 ` Tom Moran
  1997-03-16  0:00 ` Matthew Heaney
  0 siblings, 2 replies; 5+ messages in thread
From: Mats Weber @ 1997-03-14  0:00 UTC (permalink / raw)



There was a discussion some time ago in comp.lang.ada on whether Adjust,
Finalize and Initialize for Controlled types was better done in the
visible or private part of the package. In both cases, the type was
visibly derived from Ada.Finalization.Controlled.

I'd like to know if it is better to make types visibly derived from
Ada.Finalization.Controlled, or do that derivation in the private part:

Visible:

   generic
      type Element_Type is private;
      with function "=" (Left, Right : Element_Type) return Boolean;
      with function "<" (Left, Right : Element_Type) return Boolean;
   package Binary_Trees is

      type Binary_Tree is new Ada.Finalization.Controlled with private;

      procedure Adjust, ...

      ...

   private

      type Binary_Tree is new Ada.Finalization.Controlled with
         record
            ...
         end record;

   end;

or invisible:

   generic
      type Element_Type is private;
      with function "=" (Left, Right : Element_Type) return Boolean;
      with function "<" (Left, Right : Element_Type) return Boolean;
   package Binary_Trees is

      type Binary_Tree is private;

      ...

   private

      type Binary_Tree is new Ada.Finalization.Controlled with
         record
            ...
         end record;

      procedure Adjust, ...

   end;

Any ideas on which approach is best ?




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

end of thread, other threads:[~1997-03-17  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-14  0:00 Visible or hidden derivation for controlled types ? Mats Weber
1997-03-15  0:00 ` Tom Moran
1997-03-17  0:00   ` Jon S Anthony
1997-03-16  0:00 ` Matthew Heaney
1997-03-16  0:00   ` Robert Dewar

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