As I just begin a nTh CL version in Java, I just crash on some problems.
It's not in the language implementation itself (witch is mainly easy), but in some details that you can grab in current implementations. X3J13 doesn't give advice about. Examples are tested on CLisp.
Though... REPL in lisp can be made in a simple and classical way as :
Code: Select all
(loop(write(eval(read))))
Why ? as :
Code: Select all
(read) -> '(a b) -> (quote (a b))
(eval (quote(a b))) -> (a b)
(write (a b)) -> a is not a function
Code: Select all
(write(eval '(a b)))
A hint is perhaps :
"20.1. Run-Time Evaluation of Forms"
If the predicate constantp is true of an object, then that object, when considered as a form to be evaluated, always evaluates to the same thing; it is a constant. This includes self-evaluating objects such as numbers, characters, strings, bit-vectors, and keywords, as well as all constant symbols declared by defconstant, such as nil, t, and pi. In addition, a list whose car is quote, such as (quote foo), is considered to be a constant.
I probably loose something somewhere.
Best regards
Ivan