Fix weak-value hash tables.
authorLudovic Courtès <ludo@gnu.org>
Thu, 23 Sep 2010 09:51:28 +0000 (11:51 +0200)
committerLudovic Courtès <ludo@gnu.org>
Thu, 23 Sep 2010 20:02:11 +0000 (22:02 +0200)
commit5a99a574e43a08817f21bdeebe1c302051ffb237
treec4ca87956c543979881552854de8c9999ca9e88f
parentcb2d8076effd1b3f0a01a7148af5a97b64f4c29d
Fix weak-value hash tables.

* libguile/hashtab.c (scm_hash_fn_set_x): Register a disappearing link
  to VAL when TABLE is weak-value.

* test-suite/tests/weaks.test ("weak-hash")["weak-key dies", "weak-value
  dies", "doubly-weak dies"]: Use `hash-set!' and `hash-ref', not
  `hashq-set!' and `hashq-ref', otherwise these tests would always
  succeed because (eq? "this" "this") => #f.
  ["lives"]: Use `hash-ref' and `hash-set!' too for consistency.
libguile/hashtab.c
test-suite/tests/weaks.test