The class of linked lists.
Lists are constructed by linking together instances of <pair>. The head of a list contains an element, and the tail of the list contains a pointer to the next pair on the list. The list ends when the tail of a pair contains something besides another pair.
A proper list has a final pair with a tail containing the empty list.
An improper list does not have a final pair with a tail containing the empty list, either because the tail of its final pair is not the empty list, or because the list is circular and thus does not have a final pair. Except when their behavior on improper lists is documented explicitly, collection or sequence functions are not guaranteed to return an answer when an improper list is used as a collection or sequence. These functions may return the correct result, signal a <type-error>, or (in the case of a circular list) fail to return.
When treated as a collection, the elements of a list are the heads of successive pairs in the list.
The <list> class is partitioned into two concrete subclasses, <pair> and <empty-list>. Calling make on <list> will return a linked list made from pairs and terminated with the empty list.
abstract free sealed
| size: | An instance of <integer> specifying the size of the list. The default value is 0. |
| fill: | An instance of <object> specifying an initial value for each element of the list. The default value is #f. |