[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
EVAL
- To: Common-Lisp@SU-AI.ARPA
- Subject: EVAL
- From: Alan Bawden <ALAN@AI.AI.MIT.EDU>
- Date: Sun, 30 Nov 86 03:26:23 EST
- In-reply-to: Msg of Wed 26 Nov 86 11:10 est from mike%acorn at mit-live-oak.arpa
Date: Wed, 26 Nov 86 11:10 est
From: mike at acorn
Date: Wed, 26 Nov 86 00:24:12 EST
From: Alan Bawden <ALAN at AI>
... How do you compile
(defun bind-x-then-call-f (x f)
(funcall f `(cons x x)))...
I just write
(defun bind-x-then-call-f (x f)
(eval `(funcall ,f '(cons ,x ,x)))...
I presume you mean this to be
(defun bind-x-then-call-f (x f)
(eval `(funcall ',f '(cons ',x ',x)))).
The quotes prevent an extra evaluation I doubt you intended.
You can't rewrite BIND-X-THEN-CALL-F this way because before your rewrite
it was the case that:
(bind-x-then-call-f 7 #'cadr) ==> X
but afterwords:
(bind-x-then-call-f 7 #'cadr) ==> (QUOTE 7)