summaryrefslogtreecommitdiff
path: root/doc/ref/api-memory.texi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2014-02-07 12:25:05 +0100
committerAndy Wingo <wingo@pobox.com>2014-02-07 12:25:05 +0100
commit1e3fd6a0c81bb3e9900a93a9d1923cc788de0f99 (patch)
tree470e5eb1a69d7d4ec7a72f6d0c2a029026de9782 /doc/ref/api-memory.texi
parent40a723a92236fe4e58feb89057b4182b1fc76810 (diff)
downloadguile-1e3fd6a0c81bb3e9900a93a9d1923cc788de0f99.tar.gz
Add weak-vector-length, weak-vector-ref, weak-vector-set!
* libguile/weaks.c (scm_is_weak_vector, scm_c_weak_vector_length): (scm_c_weak_vector_ref, scm_c_weak_vector_set_x): New interfaces for dealing with weak vectors from C. (scm_weak_vector_length, scm_weak_vector_ref, scm_weak_vector_set_x): New Scheme interfaces to weak vectors; to be used instead of vector-length, vector-ref, etc. * module/ice-9/weak-vector.scm: Export the new interfaces. * doc/ref/api-memory.texi (Weak vectors): Document them.
Diffstat (limited to 'doc/ref/api-memory.texi')
-rw-r--r--doc/ref/api-memory.texi13
1 files changed, 12 insertions, 1 deletions
diff --git a/doc/ref/api-memory.texi b/doc/ref/api-memory.texi
index ff202e00e..8d0c8fef2 100644
--- a/doc/ref/api-memory.texi
+++ b/doc/ref/api-memory.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2012
+@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010, 2012, 2014
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@@ -413,6 +413,17 @@ Return @code{#t} if @var{obj} is a weak vector. Note that all
weak hashes are also weak vectors.
@end deffn
+@deffn {Scheme Procedure} weak-vector-ref wvect k
+@deffnx {C Function} scm_weak_vector_ref (wvect, k)
+Return the @var{k}th element of the weak vector @var{wvect}, or
+@code{#f} if that element has been collected.
+@end deffn
+
+@deffn {Scheme Procedure} weak-vector-set! wvect k elt
+@deffnx {C Function} scm_weak_vector_set_x (wvect, k, elt)
+Set the @var{k}th element of the weak vector @var{wvect} to @var{elt}.
+@end deffn
+
@node Guardians
@subsection Guardians