[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Implementing :TEMPORARY hash tables at the Lisp level?



> I know of at least one case in Symbolics Common Lisp where (eq #'foo #'foo)
> returns false.  However, foo was defined with a non-Common-Lisp construct
> (defun-in-flavor).  It wouldn't surprise me to learn that there are
> implementations where the same thing happens when foo was defined with
> FLET, in cases where the surrounding lexical environment structure is
> sufficiently complex.  As you pointed out, the same thing can happen with
> functions defined globally, in the implementation technique used in
> Interlisp-10.
> 
> One could see how to add hair to a compiler to avoid these situations, but
> it may be infeasible in an interpreter.

Modulo certain efficiency considerations, as in Interlisp-10, I do not
think there is any particular difficulty in having (eq #'f #'f) return
true.  Presumably, interpreters do not have any trouble with

     (let ((f #'(lambda ...)))
       (eq f f))                  ==> t

Are there optimization considerations, as there are for numbers and
EQ, that argue against having EQ be well-defined to the extent of
being able to make comparisons such as (eq x #'eq) [which I think
is all that's needed for make-hash-table]?