Next: , Up: Containers


7.1 Lists

— Built-in Function: list (a1, a2, ...)

Create a new list with elements given by the arguments a1, a2, ....

— Built-in Function: nth (list, n)

Return the n-th element of list.

— Built-in Function: append (list, a1, a2, ...)

Return a new list created by appending a1, a1, ..., to list. If any of the arguments to be appended is a list, its elements are appended individually. For example,

          x = list (1, 2);
          y = list (3, 4);
          append (x, y);
     

results in the list containing the four elements `(1 2 3 4)', not a list containing the three elements `(1 2 (3 4))'.

— Built-in Function: reverse (list)

Return a new list created by reversing the elements of list.

— Built-in Function: splice (list_1, offset, length, list_2)

Replace length elements of list_1 beginning at offset with the contents of list_2 (if any). If length is omitted, all elements from offset to the end of list_1 are replaced. As a special case, if offset is one greater than the length of list_1 and length is 0, splice is equivalent to append (list_1, list_2).

— Built-in Function: islist (x)

Return nonzero if x is a list.