CoCoA:First

From ApCoCoAWiki
Revision as of 10:02, 24 October 2007 by XMLBot (talk | contribs) (pushing XML rev. 1.46, again)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

First

the first N elements of a list

Description

In the first form, the function is the same as the function <ttref>Head</ttref>;

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]
-------------------------------

Syntax

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

Head

Last

   <type>list</type>