|
In LISP, every list is a tree, but not every tree is a list. The LISP jargon for tree is S-expression. A tree whose rightmost path from the root leads to nil is a list. A tree whose rightmost path from the root leads to an atomic symbol other than nil is not a list. Notice that a nonlist may have subtrees that are lists, and a list may have entries that are nonlists. A tree all of whose right edges lead either to internal nodes or nils is composed entirely of nested lists. LISP has a slightly redundant notation, capable of describing all trees, but tuned to describe lists more concisely than other trees. The McCarthy article that I handed out covers this fairly thoroughly. For example, Mike O'D. |
to: