A session with XLISP-STAT basically consists of a conversation between
you and the * listener*. The listener is the window into which you
type your commands. When it is ready to receive a command it gives you
a prompt. At the prompt you can type in an expression. You can use the
mouse or the * backspace* key to correct any mistakes you make
while typing in your expression. When the expression is complete and
you type a * return* the listener passes the expression on to the
* evaluator*. The evaluator evaluates the expression and returns
the result to the listener for printing. The evaluator is the heart of the
system.

The basic rule to remember in trying to understand how the evaluator works is that everything is evaluated. Numbers and strings evaluate to themselves:

> 1 1 > "Hello" "Hello" >Lists are more complicated. Suppose you type the list

> (+ 1 2 3) 6 >A list is evaluated as a function application. The first element is a symbol representing a function, in this case the symbol

Actually, the arguments to a function are always evaluated before the function is applied. In the previous example the arguments are all numbers and thus evaluate to themselves. On the other hand, consider

> (+ (* 2 3) 4) 10 >The evaluator has to evaluate the first argument to the function

Occasionally you may want to tell the evaluator * not* to evaluate
something. For example, suppose we wanted to get the evaluator to
simply return the list ` (+ 1 2)` back to us, instead of
evaluating it. To do this we need to * quote* our
list:

> (quote (+ 1 2)) (+ 1 2) >

> '(+ 1 2) ; single quote shorthandThis is equivalent to

By the way, the semicolon ``` ;`'' is the Lisp comment character.
Anything you type after a semicolon up to the next time you hit a
* return* is ignored by the evaluator.

Tue Jan 21 15:04:48 CST 1997