The Lisp Top-Level

Summary: A Lisp Top-Level is a program which allows interactive evaluation of Lisp expressions.
up
prev next

search
site map
navigate
about

<*LISP*>
<*learning*>
<*applications*>
<*tools*>
<*community*>
<*references*>
<*systems*>
<*related*>

top-level
syntax
evaluation
environment
objects
dynamic
typing
memory
macros
performance
3GL
history
compare
combine

Like other computer languages, Lisp allows one to create distinct applications which carefully control their own interaction with the user.

In addition, most Lisp implementations provide a program (i.e. an "executable", "application", or "image") which allows a user to interact directly with Lisp. This is called the Lisp Top-Level.

The Lisp Top-Level is also called a read-eval-print loop, because it is an endless loop that reads a Lisp expression, evaluates it, and print the results.

Some people refer to this as an "interpreter". It is an interpreter in the sense that any Lisp expressions typed directly into the Lisp Top-Level will be read, evaluated, and printed. However, these expressions might simply be invocations of previously compiled functions, which will be executed as compiled code. See Evaluation in Lisp.

One way to think of the Lisp Top-Level is as a very powerful "shell" in which users have access to the full complement of Lisp utilities, including file and stream access, the compiler, and the ability to load source or previously compiled files.

Some implementations allow only one such process to run at a time, while others allow multiple process. Those that do allow multiple processes automatically share memory between processes and allow programs to directly create and control the various processes.

Lisp programs signal controlled errors rather than simply dumping core. Any Lisp program can trap these error conditions and invoke a system supplied, interactive debugger. This debugger includes a read-eval-print loop similar (or even identical) to the Lisp Top-Level. Lisp programs can also cause a read-eval-print loop to be invoked simply by calling the function BREAK. In fact the entire Lisp Top-Level application could be written as essentially a single call to the function BREAK.