Re: Confused by behavior of LispWorks for code snippet



Damien Kick wrote:
With LispWorks Personal Edition 5.0.1 (PowerPC), I see the following behavior:

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

CL-USER 2 > *x*
#<anonymous interpreted function 200EB012>

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

CL-USER 6 > (eql #'f #'g)
NIL

CL-USER 7 > (eql #'f *x*)
NIL

CL-USER 8 > (eq *x* *x*)
T
</code>

I would've expected (EQ #'F #'G) => T. I am getting that result, i.e. (EQ #'F #'G) => T, with both Allegro CL 8.0 and Clisp. Is LispWorks mistaken or is that an allowable result?

FWIW, on LWM 5.0.2 (Intel) I get

CL-USER 121 > (defparameter *x* (lambda () 27))
*X*

CL-USER 122 > (setf (symbol-function 'f) *x*)
#.#'(LAMBDA () 27)

CL-USER 123 > (setf (symbol-function 'g) *x*)
#.#'(LAMBDA () 27)

CL-USER 124 > (eql #'f #'g)
T

CL-USER 125 >

-Klaus.
.