Interacting with the Listener
?(+ 10 20 30)60?(aref #(a b c d) 0)A ?"Simple String""Simple String"
Every kind of Lisp expression has its own rules for evaluation. The first two examples given above are function calls, which evaluate to the result of calling the function on the arguments. The third example is a string constant. String constants (like other constants) evaluate to themselves.
Figure 2-3 A simple Listener interaction
You can also type more complex expressions into the Listener. Many expressions will contain nested subexpressions. It is also common to test out function and class definitions in the Listener.
?(+ 25 (* 10 10) (* 5 5))150 ?(defun factorial (n)(if (= n 0)1(* n (factorial (- n 1)))))FACTORIAL ?(factorial 10)3628800
Generated with Harlequin WebMaker