hash-set! on weak tables returns the value
authorAndy Wingo <wingo@pobox.com>
Fri, 2 Mar 2012 17:26:56 +0000 (18:26 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 2 Mar 2012 17:26:56 +0000 (18:26 +0100)
commit07e69928fcab0c5a0e1133fc1f66b18ddd09d408
tree00ec631659231092c23d7a5b43fcf0b48d478676
parentdee4e3ee3cbd4badeaf9beedfaf4cd8800f56a0b
hash-set! on weak tables returns the value

* libguile/weak-table.h:
* libguile/weak-table.c (scm_weak_table_putq_x)
  (scm_weak_table_remq_x, scm_weak_table_clear_x)
  (scm_weak_table_for_each): Declare these as returning void instead of
  SCM.
* libguile/hashtab.c (scm_hashq_set_x, scm_hashq_remove_x)
  (scm_hashv_set_x, scm_hashv_remove_x)
  (scm_hash_set_x, scm_hash_remove_x)
  (scm_hashx_set_x, scm_hashx_remove_x):
  (scm_hash_for_each): For weak tables, have the set! functions return
  the values, as they used to do.  Have remove! functions return #f,
  indicating the lack of a handle.  Shim around for-each to return
  unspecified, even though that wasn't yet a problem.

* test-suite/tests/weaks.test: Add a test.
libguile/hashtab.c
libguile/weak-table.c
libguile/weak-table.h
test-suite/tests/weaks.test