Re: Confused by behavior of LispWorks for code snippet



Damien Kick <dkixk@xxxxxxxxxxxxx> writes:

Tobias C. Rittweiler wrote:
Damien Kick <dkixk@xxxxxxxxxxxxx> writes:

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?

FUNCTION is allowed to return a fresh function object.

I don't find anything in the hyperspec which seems to support this. I
could very well be missing something, though. [...]

Well, there's 3.1.4 which says

That is, two /functions/ that are behaviorally indistinguishable might
or might not be identical.

If I remember correctly, this was a bit better worded in either CLtL or
CLtL2. But even there, it required some between-the-lines reading.

I think, it's just consensus that even `(flet ((f ...)) (eq #'f #'f))'
is allowed to return NIL.


But then, it's better to think of FUNCTION operating in this manner
anyway in face of function redefinition, and tracing/profiling.


-T.
.