The Listener tool interactively evaluates the Lisp forms you enter. During a typical session, you evaluate pieces of code in the Listener, then examine the effects in other tools, returning to the Listener whenever you want to evaluate another piece of. The structure of this tutorial reflects this two-stage approach.
Except on Unix platforms, a Listener is created when you start the LispWorks IDE. If you don't currently have a Listener (check the Window menu), start one by choosing Window > Tools > Listener or clicking on in the LispWorks toolbar. This section of the tutorial demonstrates some of its more useful features. A Listener window is shown in Listener below.
Figure 2.2 Listener
The Listener contains two views: the Listener view and the output view. At the bottom of the Listener is an echo area that is visible in either view. The echo area is used to prompt you for information when performing editor commands such as searching for text. You can switch between the two views by clicking the
tabs respectively. You can evaluate Lisp forms in the Listener view by typing the form, followed by
. Any output that is produced is displayed in the Listener view.
(+ 1 2)
The result of the evaluation, 3, appears in the Listener, and a new prompt is printed. Notice that the number in the prompt has been incremented, indicating that a form has been evaluated.
Because you may want to enter a number of very similar forms, commands are provided which make this easy.
The form that you just evaluated is printed at the new prompt. You can press
to evaluate this form again, or, more usefully, you can edit the form slightly before evaluating it.
Ctrl+Bto move the cursor back one space. Now press the
Backspacekey to delete the number
2, and type
3in its place.
You have edited the form
(+ 1 2)
to create a new form,
(+ 1 3)
Returnto evaluate the new form.
The result of the evaluation, 4, appears in the Listener, followed by another new prompt, with the prompt number incremented once again.