comp.lang.ada
 help / color / mirror / Atom feed
* How is this done?
@ 1994-12-22 17:35 Brian R. Hanson
  1994-12-23 15:26 ` Norman H. Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: Brian R. Hanson @ 1994-12-22 17:35 UTC (permalink / raw)


Given the following package and procedure definitions - 


with Text_Io;
package body Gen_List is 
   procedure View (L: in List) is
   begin
      Text_Io.Put_Line("This is output from view = " & List'Image(L));
   end;
end Gen_List;

generic
package Gen_List is
   type List is new Integer;
   procedure View (L: in List);
end Gen_List;

package body New_List is
   procedure Init (L: out List) is
   begin
      L := 5;
   end;
end New_List;

with Gen_List;
package New_List is
   type List is private;
   procedure View (L: in List);
   procedure Init (L: out List);
private
   package Old_List is new Gen_List;
   type List is new Old_List.List;
end New_list;

with New_List; use New_list;
procedure test is
   A: List;
begin
   View(A);
end test;


What needs to be done to have New_List.View use the View procedure 
that is the result of the type definition for New_List.List?

If I define a body for View in the body of New_List than it overrides
the procedure made available by the type definition - but I have to 
provide a procedure View to get things to compile.

Brian
brh@cray.com




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

end of thread, other threads:[~1994-12-23 15:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1994-12-22 17:35 How is this done? Brian R. Hanson
1994-12-23 15:26 ` Norman H. Cohen

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