Package gnu.lists

Class Pair

All Implemented Interfaces:
BoundedHashable, Consumable, Sequence<Object>, Externalizable, Serializable, Comparable, Iterable<Object>, Collection<Object>, List<Object>, SequencedCollection<Object>
Direct Known Subclasses:
ImmutablePair, Translator.FormStack

public class Pair extends LList implements Externalizable
A "pair" object, as used in Lisp-like languages. When used to implement a list, the 'car' field contains an element's value, and the 'cdr' field points to either the next Pair or LList.Empty (which represents the end of the list). (The names "car" and "cdr" [pronounced "coulder"] are historical; better names might be "value" and "next".) While a Pair is normally usued to implement a linked list, sometimes the 'cdr' field points to some other non-list object; this is traditionally callled a "dotted list".
See Also: