[Next] [Previous] [Up] [Top] [Contents] [Index]

Chapter 2: A Brief Tour of MCL

Interacting with the Listener

When you are running MCL, the Lisp heap consists of a variety of objects: classes, functions, symbols, arrays, user-interface objects, etc. Functions and special forms are used to perform operations on these objects. Definitions are used to create and define the structure of these objects.

The Listener is a window into which you can type Lisp expressions for immediate execution. These expressions may create new objects and/or they may interact with existing objects. In either case, the result of executing the expression is printed as a return value in the Listener.

The Listener corresponds to a process in the MCL runtime. The process is in a loop, called a read-eval-print loop. The loop reads an expression, evaluates it, and then prints the result. In the case of MCL, evaluation usually consists of compiling the expression and then executing the result. However, the compiler is fast enough that the Listener still gives the impression of being an evaluator window.

There can be multiple Listeners in MCL. Each one will correspond to its own process. (Your program can also have additional processes which do not correspond to any Listener.) For now, we are just going to be using one Listener, and one process.

Figure 2-2 A Listener window

You'll recognize the Listener from its name in the title bar, "Listener," and from the question mark prompt. Whenever you see this question mark, the Listener is ready to read input.

The Listener is natural and straightforward to use. Text you enter into it appears in boldface. Text printed back appears in normal type. This convention is carried over to the examples given in this manual.

? "Hello, world!" ;This is what you type.

"Hello, world!" ;This is MCL's response.

Evaluating expressions
Working with the Listener
The Listener and the Lisp Heap
The Listener and text files

Gettmg Started with MCL - 19 OCT 1996
[Next] [Previous] [Up] [Top] [Contents] [Index]

Generated with Harlequin WebMaker