Page 2 of 2

The REPL calls EVAL

Posted: Wed Dec 31, 2008 9:46 pm
by danb
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).

Re: REPL problems in Lisp

Posted: Wed Jan 07, 2009 11:08 pm
by aloyslisp
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.

Re: REPL problems in Lisp

Posted: Wed Jan 21, 2009 2:18 pm
by Wodin
aloyslisp wrote:As I just begin a nTh CL version in Java, I just crash on some problems.
See also http://common-lisp.net/project/armedbear/