Talk: List
From open-encyclopedia.com - the free encyclopedia.
Changes I made:
- Lists are not necessary allowed to be of heterogenous type, though the traditional Lisp lists of course are. Lists in Standard ML, for example, must be of a specific type (e.g. int list, or string list).
- The traditional way of implementing lists, originating with Lisp, is using cons cells: each list element has a "car" field containing the value, and a "cdr" field pointing to the next element (or NULL/null/nil/etc. for the last element). This turns into a linked list for non-nested lists, or a tree for nested lists. Lists can be implemented with arrays, but this isn't standard (or common, afaik).
--Delirium 03:47 6 Jul 2003 (UTC)