As someone who has learnt and loves Lisp it's really confusing to me that REPL has come to mean simply command interface.
This is the REPL:
(loop (print (eval (read))))This is the REPL:
(loop (print (eval (read))))it's more a PEL: Parse Execute Loop
(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))
ADDRead Eval Print Loop