Then what is this?
(defun add (a b)
(+ a b)) (defun add (a b)
(+ a b))If you enter it at a Lisp REPL, the REPL will read the expression, evaluate it and store it as a function. The result value is the name of the defined function. The REPL will then print the result, here the name of the function: ADD.
CL-USER 13 > (defun add (a b)
(+ a b))
ADD
As you can see, the function does not print the Lisp symbol 'ADD', it's printed by the REPL. That's the P-component of R E P L, REPL. P stands for PRINT. This means that the REPL will always print a result - unless a Lisp function does not have a result - which is rare.If we execute the function, the REPL prints the result of the function:
CL-USER 14 > (add 17 25)
42
Here the result is the number 42. CL-USER> (defun add (a b) (+ a b))
ADD