LISP

FIELDS OF STUDY

Programming Languages; Software Engineering

ABSTRACT

LISP is the second-oldest programming language still in common use, and is one of the preferred languages for research and development in the field of artificial intelligence. Numerous variations of the language exists, but are becoming standardized in the variations called Common LISP and Scheme. LISP is designed for the manipulation of lists of data objects, rather than for “number crunching,” although it is founded on principles of mathematical logic. The language was developed in 1958.

PRINICIPAL TERMS

HISTORY AND CHARACTERISTICS OF LISP

LISP is the second-oldest of programming languages that is still in common use. LISP, a contraction of the words LISt Processor, was described in 1958, by John McCarthy, at MIT. It has been most commonly used in university laboratories and only recently has it become more generally utilized in specialized fields that rely of the manipulation of data lists. LISP is prefered for research and development in the field of artificial intelligence. It is a high-level declarative language developed for manipulating lists of data objects, rather than for numerical calculation. There are dozens of variations of the LISP language that have not been fully standardized. Efforts to bring LISP into compliance with a standard definition of the language by ANSI and IEEE have focused on the Common LISP and Scheme variations of LISP. Symbols and lists are the essential data types for the theory behind the LISP language. Math data types are not central to LISP programming although LISP does support floating point arithmetic and integers of all sizes. A math calculation carried out in a LISP program will therefore be expected to return a complete numerical value rather than an abbreviated, rounded value.

PROGRAM FEATURES OF LISP

(a*b) + (c*d)

but in LISP this is written as

(+ (* a b) (* c d))

When this is understood, the construction of complex mathematical statements using LISP's built-in assortment of functions becomes much easier. For example, writing a LISP expression to evaluate a relation that adds two numbers and multiplies the product by some multiple of a trigonometric function can be written simply in LISP as

(* 4.5 (sin 27.5) (+ 6 7))

The code for such an expression is both compact and efficient, and conducive to the use of very extensive statements. All LISP procedures have the same value in syntax as a function, and each one returns a data object as its associated value when called. A data object may be anything from a single character to a long string of symbols or a numerical value, depending on the contextual nature of the procedure. A list is a sequence of data objects delimited by parentheses. For example, a list of three data objects (DOn) would appear as

(DO1 DO2 DO3).

Lists can also contain lists. The structure

((DO1 DO2) (DO3 DO4))

is a list of two lists. Symbols are strings of letters, digits and special characters, and have different contextual meanings in different statements. They typically serve as identifiers in LISP programs, much like an assigned variable name in other languages. There is a special form in LISP, called the lambda form, that allows mentioning a procedure without a specified name. For example, to evaluate a function that accepts three numerical values and calculates the solution of the corresponding quadratic equation y = ax2 + bx + c, one could write




PRINICIPAL TERMS

SAMPLE PROBLEM

Write a lambda form that accepts two numbers b and h, and evaluates the corresponding area of a right triangle.

Answer:

The formula for the area of a right triangle is A = ½ bh. Therefore the corresponding lambda form would be




PRINICIPAL TERMS

VALUE OF LISP PROGRAMMING

The use of data objects and lists in LISP programming and its basis on logic principles have made it a language of choice for artificial intelligence studies and development. These capabilities also make it useful for manipulating the source code of programs written in other languages, and may be an essential feature in developing computer applications that can “learn” as they carry out their functions.

—Richard M. Renneboog M.Sc.

Barski, Conrad. Land of Lisp. Learn to Program LISP One Game at a Time. San Francisco, CA: No Starch Press, 2011. Print.

Kramer, Bill. The Autocadet's Guide to Visual LISP. Laurence, KS: CMP Books, 2002. Print.

Méndez, Luis Argüelles. A Practical Introduction to Fuzzy Logic Using LISP. New York, NY: Springer, 2016. Print.

O'Regan, Gerard. A Brief History of Computing 2nd ed., New York, NY: Springer-Verlag, 2012. Print.

Scott, Michael L. Programming Language Pragmatics 4th ed., Waltham, MA: Morgan Kaufmann. Print.

Seibel, Peter. Practical Common LISP New York, NY: Apress/Springer-Verlag. Print.

Touretzky, David S. Common LISP. A Gentle Introduction to Symbolic Computation Mineola, NY: Dover Publications. Print.