Name:

head gives the first element of a list.

Usage:

head(L) : list -> any type

Parameters:

  • L is a list.

Description:

  • head(L) returns the first element of the list L. It is equivalent to L[0].
  • If L is empty, the command will fail with an error.

Example 1:

   > head([|1,2,3|]);
   1
   > head([|1,2...|]);
   1
See also: tail
Go back to the list of commands