[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MIT-Scheme-devel] weak hash table data
From: |
Taylor R Campbell |
Subject: |
[MIT-Scheme-devel] weak hash table data |
Date: |
Tue, 22 Dec 2009 01:09:09 -0500 |
User-agent: |
IMAIL/1.21; Edwin/3.116; MIT-Scheme/7.7.90.+ |
Key-weak hash tables are never cleaned automatically, not even in a
secondary GC daemon; unless you call HASH-TABLE/CLEAN! or cause them
to be rehashed, broken entries will retain their data (but not their
keys) strongly.
(let ((a (make-eq-hash-table))
(b (make-eq-hash-table)))
(let ((p (list 'p))
(q (list 'q))
(r (list 'r)))
(hash-table/put! a p q)
(hash-table/put! b q r))
(gc-flip)
(list (hash-table/datum-list a)
(hash-table/datum-list b)))
;Value: (() ((r)))
The manual doesn't claim that *associations* are deleted from weak
hash tables if their keys are reclaimed -- it says only that the hash
table holds its keys weakly --, but this is not the behaviour I expect
for an object called a `weak hash table'. Does this behaviour worry
anyone else?
- [MIT-Scheme-devel] weak hash table data,
Taylor R Campbell <=