Comment 1 for bug 543473

Revision history for this message
Nathan Froyd (froydnj) wrote :

Renaming :WEAKNESS to :PRESERVE-IF does not seem like a beneficial change. I think the revised docstring is a (small) improvement over the existing docstring.

But the new docstring could stand a little editing: removing the :PRESERVE-IF comment is the first step. We don't need our documentation to tell users about how we thought things ought to be done.

How about something like:

"When :WEAKNESS is not NIL, garbage collection may remove entries from the hash table. The value of :WEAKNESS specifies how the presence of a key or value in the hash table preserves their entries from garbage collection. Valid values are:

:KEY means that the key of an entry must be live to guarantee that the entry is preserved.

:VALUE means that the value of an entry must be live to guarantee that the entry is preserved.

:KEY-AND-VALUE means that both the key and the value must be live to guarantee that the entry is preserved.

:KEY-OR-VALUE means that either the key or the value must be live to guarantee that the entry is preserved."