Each term Term in the list is called an element. The number of elements is said to be the length of the list.
Example:
A list where the tail is a list is sometimes called a proper list. It is allowed to have a list where the tail is not a list, for example, [a|b]. However, this type of list is of little practical use.
- 1> L1 = [a,2,{c,4}].
- [a,2,{c,4}]
- 2> [H|T] = L1.
- [a,2,{c,4}]
- a
- 4> T.
- [2,{c,4}]
- 5> L2 = [d|T].
- 6> length(L1).
- 3
- 7> length([]).
- 0
A collection of list processing functions can be found in the manual page in STDLIB.