up previous next
the first N elements of a list
first(L: LIST): OBJECT
first(L: LIST, N: INT): OBJECT |
In the first form the function returns the first element of the list
L, same as
L[1]
.
In the second form, it returns the list of the first N elements of L,
same as
[ L[i] | i in 1..N ]
/**/ L := [1,2,3,4,5];
/**/ first(L);
1
/**/ first(L,3);
[1, 2, 3]
|