|
|
|
|
|
by flavio81
3216 days ago
|
|
Take a look at Smalltalk's environment and take a look a t Common Lisp's REPL. They have all the features that make for a good 'REPL'. (As noted before, REPL is a Lisp term that stands for: read - from keyboard input, parse the input string into the syntactic structure of the language eval - eval the expression, this includes binding variables or defining new functions, also re-defining functions, even if such function is currently under execution on the running program. print - print the result of the evaluation (in Lisp all expressions evaluate to something, even if this 'something' is NIL). loop - go to 'read') |
|
Minor nitpick, but note that if you define:
Then (foo) does not return a value and accordingly, the REPL prints nothing. But in a context where you need a value, that value would be NIL: if A evaluates to 3, then after (setf a (foo)) it will evaluate to NIL.