XL (programming language): Difference between revisions

Content deleted Content added
German wikipedia describes another language with the same name
Line 69:
XL1 type checking is [[data type|static]], with [[generic programming]] capabilities that are beyond those of languages like C++ or Ada. Types like arrays or pointers, which are primitive in languages like C++, are declared in the library in XL. For instance, a one-dimensional array type could be defined as follows:
 
generic [DataItemItem : type; Size : integer] type array
 
A ''validated generic type'' is a generic type where a condition indicates how the type can be used. Such types need not have generic parameters. For instance, one can declare that a type is <code>ordered</code> if it has a less-than operator as follows:
Line 86:
This also applies to generic types that have parameters, such as <code>array</code>. A function computing the sum of the elements in any array can be written as follows:
 
function Sum(A : array) return array.DataItemItem is
I : integer
for I in 0..array.Size-1 loop
result += A[I]