20.2 Evaluating simple forms

Type the number
12
at the prompt, and press
Return
.

In general, assume that you should press
Return
after typing something at the prompt, and that you should type at the
current prompt (that is, the one at the bottom of the screen). In fact, the latter is not always necessary; Execute mode describes how to move the cursor to different places, and thus you may not always be on the current prompt.

Any Common Lisp form entered at the prompt is evaluated and its results are printed immediately below in the Listener.

When Common Lisp evaluates a number, the result is the number itself, and so
12
is printed out:

PROMPT >
12

12

PROMPT >

When results are printed in the Listener, they start on the line following the last line of input. The
12
has been printed immediately below the first prompt, and below that, another prompt has been printed.

The expression sets the variable
val
to
12
. The result of evaluating the form is the value to which
val
has been set, and thus the Listener prints
12
below the form typed at the prompt.

This is exactly the same behavior as before, when you typed a number it was evaluated and the result printed in the Listener. What is different this time, of course, is that Lisp has been told to "remember" that
12
is associated with
val
.

Type
val
.

The form is evaluated and
12
is printed below it.

Type
(+ val val val)
.

The form, which computes the sum of three
val
s, is evaluated, and
36
is printed below it.