XL (programming language): Difference between revisions

Content deleted Content added
m Type system: <source lang="ada">
Line 123:
===Type-safe variable argument lists===
Functions can be [[Polymorphism (computer science)|overloaded]]. A function can be declared to use a variable number of arguments by using <code>...</code> in the parameter list (historically, the keyword <code>other</code> was used for that purpose). In such a function, <code>...</code> can be used to pass the variable number of arguments to another subroutine, a feature now called [[Variadic templates]]:
 
<source lang="pascal">
// Generic function for the minimum of N item
function Min(X : ordered; ...) return ordered is
result := Min(...)
if X &lt;< result then
result := X
 
</source>
When such a function is called, the compiler recursively instantiates functions to match the parameter list: