File : test_function_parameter.adb
procedure Test_Function_Parameter is
type Variable_Function is access
function (N : Natural) return Natural;
type List_Of_Natural is array (Integer range <>) of Natural;
--
procedure Process (Mapping : Variable_Function; List : in out List_Of_Natural) is
begin
for Index in List'Range loop
List (Index) := Mapping (List (Index));
end loop;
end Process;
--
function Sample_Mapping (N : Natural) return Natural is
begin
return 2 * N;
end Sample_Mapping;
--
Test_List : List_Of_Natural (1 .. 10) := (others => 1);
begin
Process (Sample_Mapping'access, Test_List);
end Test_Function_Parameter;