CoCoA:Last

From ApCoCoAWiki

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>