Ada 函数指针

来源:互联网 发布:linux cc攻击 编辑:程序博客网 时间:2024/04/28 14:43


with Ada.Text_IO; use Ada.Text_IO;


procedure Main is


   type func_ptr is access procedure ( args : in String );

   
   procedure callee( msg : in String ) is
   begin
      Ada.Text_IO.Put_Line( msg );      
   end ;

   
   procedure caller( ptr : func_ptr ) is
   begin
      ptr( "In caller: send msg to callee" );
   end ;

   
begin
   caller( callee'Access );
end Main;



0 0