Let weak-table-ref kill the entry if the value is #f.

This commit is contained in:
mainzelm 2002-02-14 13:31:41 +00:00
parent 36c5c82ec3
commit 238ba3e8ba
1 changed files with 7 additions and 1 deletions

View File

@ -9,7 +9,13 @@
(define (weak-table-ref table number) (define (weak-table-ref table number)
(let ((ref (table-ref table number))) (let ((ref (table-ref table number)))
(if (weak-pointer? ref) (weak-pointer-ref ref) ref))) (if (weak-pointer? ref)
(let ((val (weak-pointer-ref ref)))
(if val
val
(begin (table-set! table number #f)
#f)))
ref)))
(define (weak-table-walk proc table) (define (weak-table-walk proc table)
(table-walk (table-walk