ABSTRACT

Lisp is a functional language, which means that all actions are accomplished by functions acting on data. A Lisp function is a program, or procedure, that accomplishes a task. Most tasks require a function to manipulate some sort of data. The term data refers to the information that a function acts on, or processes. The idea of functions in Lisp comes from the Lambda Calculus, a branch of mathematical logic developed by Alonzo Church in the 1930s. The Lambda Calculus defines mathematical computation in terms of anonymous functions, called lambda expressions, that are applied to input values to produce output values. This basic computational model is adopted by Lisp but with two important additions. First, most Lisp functions are not "anonymous", they have names associated with them. A name makes it easy to refer to a function and also gives an indication of what purpose the function serves. Secondly, not all functions in Lisp return results. Most Lisp functions behave like lambda expressions - they calculate useful values. But some functions are used for the effects they produce rather than for a value they return. For example, the purpose of the Lisp function define is to add a new definition to the language rather than to compute a result. Interaction 1 shows the two uses of functions. In the first expression the function * is called to return the product of its inputs 2 and pi. In the next line the function def ine adds a new variable definition to Lisp and does not return a value.