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

Re: hash tables and GC



I recall that in the early-70s, Interlisp-10 only had EQ hash tables and would
GC hash keys if the hash table was the only pointer. However, Peter Deutsch had
an application (a theorem prover, I think) which used hash tables as the only
pointers to his data structures and then used MAPHASH to retrieve them. So we
changed the GC not to collect hash keys; I'm not sure when, but I'd guess around
1975. We thought about having both kinds of hash tables, but didn't implement
it.

My point is that the proposal isn't a novel feature (or issue) for Lisp
implementations. 

It would be most useful to describe the proposal in terms of the semantics from
the point of view of Lisp programs rather than the implementation of the garbage
collector, especially since CLtL and the spec make almost no reference to the GC
at all. The only semantic difference between :TEMPORARY and non-:TEMPORARY  hash
tables is that MAPHASH on :TEMPORARY hash tables may find fewer entries. 

For me, the questions remaining are:

0. Is :TEMPORARY T a good indicator? The table isn't really temporary, just the
entires.  Perhaps :MAPHASH T or :MAPHASH NIL?

1. How to describe the behavior of MAPHASH on such a table; are the results
"undefined"? 

Didn't we already have this discussion on the Common-Lisp mailing list a while
ago? Or was it about DO-ALL-SYMBOLS and packages...?