On 8-Jan-09, at 8:54 PM, Lars Rune Nøstdal wrote:
> Is the doc string for make-hash-table correct?
> :key-and-value --> "either key _or_ value"
> :key-or-value --> "both the key _and_ the value"
> ..these seem to have been swapped, I think.
No, this is correct. If a hash table is weak on the key *and* on the
value, it needs an external strong reference on the key *and* the
value for the entry to remain. In other words, it's sufficient for the
key or the value to (otherwise) be garbage to drop the association.
Similarly, if a hash table is weak on the key *or* on the value, it
needs an external strong reference on the key *or* on the value for
the entry to be live. Thus, the entry will only be dropped if both the
reference and the value would otherwise be garbage.