Lists Next: Up: Containers



Lists

list (a1 a2, ...) Built-in Function
Create a new list with elements given by the arguments a1 a2 ....

nth (list n) Built-in Function
Return the n-th element of list.

append (list a1, a2, ...) Built-in Function
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)).

reverse (list) Built-in Function
Return a new list created by reversing the elements of list.

splice (list_1 offset, length, list_2) Built-in Function
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).

islist (x) Built-in Function
Return nonzero if x is a list.