Variadic Functions in Ada
Within the function, the type of Nums
is equivalent to array of Integer
. We can call Nums'Length
, iterate over it with for loop
, etc.
Variadic functions can be called in the usual way with individual arguments.
If you already have multiple args in an array, apply them to a variadic function using procedure(array)
like this.
Another key aspect of functions in Ada is their ability to form closures, which we’ll look at next.
Next example: Closures.