CoCoA:Last

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)

Last

the last N elements of a list

Description

In the first form, the function returns the last element of L. In

the second form, it returns the list of the last N elements of L.

Example

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

Syntax

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

First

Head

Tail

   <type>list</type>