soegaard2
2021-10-17 07:26:49

@sorawee Suppose we store a hash table in a weak box. Then the hash table is reachable through weak references only.

If the hash table is weak, then a value stored in the hash table is reachable through weak references only, and the garbage collector is allowed to replace the value with #f.

If the hash table not weak, then a value stored in the hash table is not reachable through weak references only (even though the hash table is stored in a weak box). Therefore the value can’t be removed by the garbage collector.

So the answer to your question must be no.


soegaard2
2021-10-17 07:34:31

However, if the hash tables aren’t stored inside weak boxes (or weak hash tables), I think, your observation holds.