[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (eq #'f #'f) and :TEMPORARY hash tables
> After all the dust has cleared, it seems that you don't need to use
> SYMBOL-FUNCTION at all to test function equality in make-hash-table or
> similar functions.
I thought I wasn't going to send anything more on this topic, but I'm
puzzled as to why it was ever thought this was an issue. MAKE-HASH-
TABLE has to find out which :TEST it has if it wants to use a
different hash function in each case. Steve has pointed out that it
doesn't really have to do this. It could just call the :TEST to
compare objects and (presumably) not use different hashes. Well,
that's certainly true, because nothing in CLtL guarantees that it
can't secretly use alists and not hash at all.
Nonetheless, it has always been fairly clear that *whatever*
MAKE-HASH-TABLE does now will suffice for :TEMPORARY tables too.
Or, rather, for permitting the existence of temp tables.
If necessary, we can bring in the fact that :TEMPORARY tables can just
be ordinary tables, because we cannot specify when entries would
actually be removed in any case. Moreover, if it is an error for the
:TEST to be anything other than EQ, #'EQ, EQL, etc. we can tell which
it is by trying it on various objects that we construct for that
purpose. And, finally, there is EQP and the like (i.e., an internal
comaprison that checks whetehr functions are composed of the same
parts).
> So it doesn't matter whether SYMBOL-FUNCTION is a plain accessor
> or not.
It may not matter here, but it generally does matter when new objects
are created and when they are not.
> FUNCTION, however, tends to be NOT a plain accessor.
Actually, it tends TO be a plain accessor. The implementations in
which it is not are (as far as I can tell) a minority.