-- test_permute.adb two instantiations of generic procedure with Ada.Text_Io; use Ada.Text_Io; with Permute; -- generic procedure Test_Permute is type Vector_Type is array(Integer range <>) of Long_Float; Vector : Vector_Type(1..3) := (1.0,2.0,3.0); type Character_Type is array(Integer range <>) of Character; Chars : Character_Type(1..5) := ('a', 'b', 'c', 'd', 'e'); type Permuters_Type is array(Integer range <>) of Integer; Permuters : Permuters_Type(1..3) :=(4,4,4); Cpermute : Permuters_Type(1..5); Last : Boolean := False; Cnt : Integer := 0; procedure My_Permutef is new Permute(Long_Float, Integer, Vector_Type, Permuters_Type); procedure Permutec is new Permute(Character, Integer, Character_Type, Permuters_Type); --type ITEM is private ; --type INDEX is range <> ; --type VECTOR_TYPE is array ( INDEX range <> ) of ITEM ; --type PERMUTERS_TYPE is array ( INDEX range <> ) of INDEX ; begin Put_Line("test_permute.adb running"); while not Last loop My_Permutef(Vector, Permuters, Last); Cnt := Cnt +1; Put_Line(Integer'Image(Cnt)&" vector "&Long_Float'Image(Vector(1))& Long_Float'Image(Vector(2))&Long_Float'Image(Vector(3))); end loop; Last := False; Cnt := 0; while not Last loop Permutec(chars, cpermute, Last); Cnt := Cnt +1; Put_Line(Integer'Image(Cnt)&" chars "&chars(1)&chars(2)& chars(3)&Chars(4)&Chars(5)); end loop; Put_Line("test_permute.adb ends"); end Test_Permute;