LISP
Lisp was invented by John McCarthy in the late 1950's as a formalism for reasoning about the use of recursion equations as a model for computation. Of computer languages still in widespread use today, only FORTRAN is older. Lisp has evolved with the field of Computer Science, always putting the best ideas from the field into practical use. In 1994, Common Lisp became the first ANSI Standard to incorporate object oriented programming.
Lisp
is a family of languages with a long history. Early key ideas in Lisp were
developed by John McCarthy during the 1956 Dartmouth Summer Research Project on
Artificial Intelligence. McCarthy's motivation was to develop an algebraic list
processing language for artificial intelligence work. Implementation efforts for
early dialects of Lisp were undertaken on the IBM 704, the IBM 7090, the Digital
Equipment Corporation (DEC) PDP-1, the DEC PDP-6, and the PDP-10. The primary
dialect of Lisp between 1960 and 1965 was Lisp 1.5. By the early 1970's there
were two predominant dialects of Lisp, both arising from these early efforts
As a programming language,
LISP is characterized by the following ideas: computing with symbolic
expressions rather than numbers, representation of symbolic expressions and
other information by list structure in the memory of a computer, representation
of information in external media mostly by multi-level lists and sometimes by
S-expressions, a small set of selector and constructor operations expressed as
functions, composition of functions as a tool for forming more complex
functions, the use of conditional expressions for getting branching into
function definitions, the recursive use of conditional expressions as a
sufficient tool for building computable functions, the use of -expressions for
naming functions, the representation of LISP programs as LISP data, the
conditional expression interpretation of Boolean connectives, the LISP function eval
that serves both as a formal definition of the language and as an interpreter,
and garbage collection as a means of handling the erasure problem. LISP
statements are also used as a command language when LISP is used in a
time-sharing environment.
Although the first implementations of Lisp were on the IBM 704 and the IBM 7090, later work focused on the DEC PDP-6 and, later, PDP-10 computers, the latter being the mainstay of Lisp and artificial intelligence work at such places as Massachusetts Institute of Technology (MIT), Stanford University, and Carnegie Mellon University (CMU) from the mid-1960's through much of the 1970's. The PDP-10 computer and its predecessor the PDP-6 computer were, by design, especially well-suited to Lisp because they had 36-bit words and 18-bit addresses. This architecture allowed a cons cell to be stored in one word; single instructions could extract the car and cdr parts. The PDP-6 and PDP-10 had fast, powerful stack instructions that enabled fast function calling. But the limitations of the PDP-10 were evident by 1973: it supported a small number of researchers using Lisp, and the small, 18-bit address space (262,144 36-bit words) limited the size of a single program. One response to the address space problem was the Lisp Machine, a special-purpose computer designed to run Lisp programs. The other response was to use general-purpose computers with address spaces larger than 18 bits, such as the DEC VAX and the S-1 Mark IIA.
LISP has two kinds of data structures: atoms and lists. Atoms are either symbols, which have the form of identifiers, or numeric literals. Delimiting their elements with parentheses specifies Lists. Lists can be either simple lists or nested lists. Internal lists as stored as single-linked list structures, in which each node has two pointers and represents a list element. A pointer to its first element references a list.
It
is a string of characters beginning with a letter, digit or special character
other than left "(" or right ")" parentheses.
Examples:
Peace
of
Mind
9518
3.1416
·
LIST
It
is a collection of S-Expression enclosed by parentheses.
Examples:
(The 100 capital sins)
(3.1416 ((peach) oranges) apricot)
·
Example Function
; The following code defines a LISP predicate function that takes
; two lists as arguments and returns True is the two lists are equal,
; and NIL otherwise
; (DEFUN equal_lists (lis1 lis2)
(COND
((ATOM lis1) (EQ lis1 lis2))
((ATOM lis2) NIL)
((equal_list (CAR lis1) (CAR lis2))
(equal_list (CDR lis1) (CDR lis2)))
(T NIL)
)
)
Free Compilers for UNIX, Linux, and Windows
Sources
http://www.apl.jhu.edu/~hall/lisp.html
http://www.alu.org/
Page Created by: Jerrell Jordan
Last Modified: March 26, 2001