Re: Confused by behavior of LispWorks for code snippet



Rob Warnock wrote:
Damien Kick <dkixk@xxxxxxxxxxxxx> wrote:
+---------------
| With LispWorks Personal Edition 5.0.1 (PowerPC),
| I see the following behavior:
....
| CL-USER 3 > (setf (symbol-function 'f) *x*)
| #<anonymous interpreted function 200EB012>
| | CL-USER 4 > (setf (symbol-function 'g) *x*)
| #<anonymous interpreted function 200EB012>
| | CL-USER 5 > (eq #'f #'g)
| NIL
+---------------

I don't use LispWorks, so this may be a totally wild hair,
but try (SETF (FDEFINITION 'F) *X*) and see what happens.
SYMBOL-FUNCTION & FDEFINITION are *supposed* to be the same
when applied to symbols, but LispWorks might be treating
them differently...

CL-USER 1 > (defparameter *x* #'(lambda () 13))
*X*

CL-USER 2 > (setf (fdefinition 'f) *x*)
#<anonymous interpreted function 200C9212>

CL-USER 3 > (setf (fdefinition 'g) *x*)
#<anonymous interpreted function 200C9212>

CL-USER 4 > (eq #'f #'g)
NIL

CL-USER 5 >
.



Relevant Pages