summaryrefslogtreecommitdiff
path: root/libguile/weak-table.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-03-02 18:26:56 +0100
committerAndy Wingo <wingo@pobox.com>2012-03-02 18:26:56 +0100
commit07e69928fcab0c5a0e1133fc1f66b18ddd09d408 (patch)
tree00ec631659231092c23d7a5b43fcf0b48d478676 /libguile/weak-table.h
parentdee4e3ee3cbd4badeaf9beedfaf4cd8800f56a0b (diff)
downloadguile-07e69928fcab0c5a0e1133fc1f66b18ddd09d408.tar.gz
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.
Diffstat (limited to 'libguile/weak-table.h')
-rw-r--r--libguile/weak-table.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/libguile/weak-table.h b/libguile/weak-table.h
index cb2831c3a..f516c2601 100644
--- a/libguile/weak-table.h
+++ b/libguile/weak-table.h
@@ -3,7 +3,7 @@
#ifndef SCM_WEAK_TABLE_H
#define SCM_WEAK_TABLE_H
-/* Copyright (C) 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2011, 2012 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -58,15 +58,15 @@ SCM_INTERNAL void scm_c_weak_table_remove_x (SCM table, unsigned long raw_hash,
void *closure);
SCM_INTERNAL SCM scm_weak_table_refq (SCM table, SCM key, SCM dflt);
-SCM_INTERNAL SCM scm_weak_table_putq_x (SCM table, SCM key, SCM value);
-SCM_INTERNAL SCM scm_weak_table_remq_x (SCM table, SCM key);
+SCM_INTERNAL void scm_weak_table_putq_x (SCM table, SCM key, SCM value);
+SCM_INTERNAL void scm_weak_table_remq_x (SCM table, SCM key);
-SCM_INTERNAL SCM scm_weak_table_clear_x (SCM table);
+SCM_INTERNAL void scm_weak_table_clear_x (SCM table);
SCM_INTERNAL SCM scm_c_weak_table_fold (scm_t_table_fold_fn proc, void *closure,
SCM init, SCM table);
SCM_INTERNAL SCM scm_weak_table_fold (SCM proc, SCM init, SCM table);
-SCM_INTERNAL SCM scm_weak_table_for_each (SCM proc, SCM table);
+SCM_INTERNAL void scm_weak_table_for_each (SCM proc, SCM table);
SCM_INTERNAL SCM scm_weak_table_map_to_list (SCM proc, SCM table);