up previous next
First

the first N elements of a list

Syntax
First(L:LIST):OBJECT
First(L:LIST,N:INT):OBJECT

Description
In the first form, the function is the same as the function Head; it returns the first element of the list L. In the second form, it returns the list of the first N elements of L.

Example
L := [1,2,3,4,5];
First(L);
1
-------------------------------
First(L,3);
[1, 2, 3]
------------------------------- 


See Also