comp.lang.ada
 help / color / mirror / Atom feed
* Q: Access subprogram with class type parameters
@ 2000-03-08  0:00 Rush Kester
  2000-03-09  0:00 ` Ted Dennison
  0 siblings, 1 reply; 2+ messages in thread
From: Rush Kester @ 2000-03-08  0:00 UTC (permalink / raw)


This is my first attempt at using subprogram access types and class
programming.

Why doesn't Default_Get_Procedure match Get_Procedure in the following?

with text_io;
procedure test is
   type Values is
      tagged record
         null;
      end record;
   type Bool_Values          is new Values
      with record
         Bool_Value : Boolean;
      end record;
   package bool_io is new text_io.enumeration_io(boolean);

   type Get_Procedure is access procedure (
     File : in text_io.file_type;
     Value : out values'class);

   procedure Default_Get_Procedure(
     File : in text_io.file_type;
     Value : out Bool_Values) is

   begin
     bool_io.get(File, Value.Bool_Value);
   end Default_Get_Procedure;

 Get_Message : Get_Procedure := Default_Get_Procedure'Access; -- what's
wrong?
-- ...
 File : text_io.file_type;
begin
  null;
end test;






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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-08  0:00 Q: Access subprogram with class type parameters Rush Kester
2000-03-09  0:00 ` Ted Dennison

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