Call a function: Difference between revisions

Line 31:
* The caller is free to use either a positional parameters or named parameters, or a mixture of both (with positional parameters first) <lang Ada>Positional := H(A, F'Access);
Named := H(Int => A, Fun => F'Access);
Mixed := H(A, Fun=>F'Access); -- mixture </lang>
 
* Ada does not allowsupport functions with a variable number of arguments. But a function argument can be an unconstrained array with as many argumentsvalues as you want:<lang Ada>type Integer_Array is array (Positive range <>) of Integer;
function Sum(A: Integer_Array) return Integer is
S: Integer := 0;
Line 40:
S := S + A(I);
end loop;
return S;
end Sum;
...
Anonymous user