REPL problems in Lisp
The REPL calls EVAL
The difference is that there are two evaluations in (eval '(a b)). When you type (eval '(a b)) into the repl, the call to READ in the repl turns the string '(a b) into the form (quote (a b)), and the call to EVAL (still in the repl) evaluates the quote form and returns the list (a b). Now your explicit call to EVAL is trying to call A as a function. When you type '(a b) into the repl, there's only one call to EVAL (the one in the repl).
--Dan B.
Re: REPL problems in Lisp
More precisely :
After testing in CLisp.
In (eval (read)), that's not the input that is evaluated but the (read) function.
Though
(eval (read)) with '(a b) -> (QUOTE (A B)) ; (READ) is evaluated : only macro-character transformation
but
(eval '(a b)) -> (eval (QUOTE (A B))) -> (A B) ; QUOTE function is evaluated
in consequence, the evaluation of arguments of the write will give different results :
(A B) in the first case
invalid function A error in the second
best regards
PS :
Textual and internal structure can be confusing. Macro-character transformation is not evaluation but input rewriting.
After testing in CLisp.
In (eval (read)), that's not the input that is evaluated but the (read) function.
Though
(eval (read)) with '(a b) -> (QUOTE (A B)) ; (READ) is evaluated : only macro-character transformation
but
(eval '(a b)) -> (eval (QUOTE (A B))) -> (A B) ; QUOTE function is evaluated
in consequence, the evaluation of arguments of the write will give different results :
(A B) in the first case
invalid function A error in the second
best regards
PS :
Textual and internal structure can be confusing. Macro-character transformation is not evaluation but input rewriting.
Re: REPL problems in Lisp
See also http://common-lisp.net/project/armedbear/aloyslisp wrote:As I just begin a nTh CL version in Java, I just crash on some problems.