Concepts of Programming Languages

(Sean Pound) #1

50 Chapter 2 Evolution of the Major Programming Languages


2.4.3.3 The Syntax of LISP
LISP is very different from the imperative languages, both because it is a func-
tional programming language and because the appearance of LISP programs is
so different from those in languages like Java or C++. For example, the syntax
of Java is a complicated mixture of English and algebra, while LISP’s syntax
is a model of simplicity. Program code and data have exactly the same form:
parenthesized lists. Consider again the list

(A B C D)

When interpreted as data, it is a list of four elements. When viewed as code, it
is the application of the function named A to the three parameters B, C, and D.

2.4.4 Evaluation


LISP completely dominated AI applications for a quarter century. Much of
the cause of LISP’s reputation for being highly inefficient has been eliminated.
Many contemporary implementations are compiled, and the resulting code is
much faster than running the source code on an interpreter. In addition to its
success in AI, LISP pioneered functional programming, which has proven to
be a lively area of research in programming languages. As stated in Chapter 1,
many programming language researchers believe functional programming is a
much better approach to software development than procedural programming
using imperative languages.

B CD

FG

BCE

A D

A

Figure 2.2


Internal representation
of two LISP lists

Free download pdf