diff options
author | Daniel Llorens <daniel.llorens@bluewin.ch> | 2013-01-23 09:59:58 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-01-23 10:00:21 +0100 |
commit | f494d4c4f6b2584b606e149dae161f9dffbab6de (patch) | |
tree | 13b4d8df8109a0e3861462071ed42d06bb50756a | |
parent | 3822c2e0d7e66210ed1cffbdd2fd9fe490d1590b (diff) | |
download | guile-wip-generalized-vectors.tar.gz |
Array documentation fixeswip-generalized-vectors
* libguile/generalized-arrays.c: Fix wording of docstring for array-length.
* doc/ref/api-compund.texi:
- Document scm_array_type(), scm_array_ref(), array-length,
scm_array_length(), scm_c_array_length().
- Fix wording of documentation for array-in-bounds?
-rw-r--r-- | doc/ref/api-compound.texi | 11 | ||||
-rw-r--r-- | libguile/generalized-arrays.c | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/doc/ref/api-compound.texi b/doc/ref/api-compound.texi index 9cd54682e..b32cc9100 100644 --- a/doc/ref/api-compound.texi +++ b/doc/ref/api-compound.texi @@ -1392,6 +1392,7 @@ as elements in the list. @end deffn @deffn {Scheme Procedure} array-type array +@deffnx {C Function} scm_array_type (array) Return the type of @var{array}. This is the `vectag' used for printing @var{array} (or @code{#t} for ordinary arrays) and can be used with @code{make-typed-array} to create an array of the same kind @@ -1399,6 +1400,7 @@ as @var{array}. @end deffn @deffn {Scheme Procedure} array-ref array idx @dots{} +@deffnx {C Function} scm_array_ref (array, idxlist) Return the element at @code{(idx @dots{})} in @var{array}. @example @@ -1409,7 +1411,7 @@ Return the element at @code{(idx @dots{})} in @var{array}. @deffn {Scheme Procedure} array-in-bounds? array idx @dots{} @deffnx {C Function} scm_array_in_bounds_p (array, idxlist) -Return @code{#t} if the given index would be acceptable to +Return @code{#t} if the given indices would be acceptable to @code{array-ref}. @example @@ -1450,6 +1452,13 @@ For example, @end example @end deffn +@deffn {Scheme Procedure} array-length array +@deffnx {C Function} scm_array_length (array) +@deffnx {C Function} size_t scm_c_array_length (array) +Return the length of an array: its first dimension. It is an error to +ask for the length of an array of rank 0. +@end deffn + @deffn {Scheme Procedure} array-rank array @deffnx {C Function} scm_array_rank (array) Return the rank of @var{array}. diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c index 11675d4cc..9c6e10e85 100644 --- a/libguile/generalized-arrays.c +++ b/libguile/generalized-arrays.c @@ -127,9 +127,8 @@ scm_c_array_length (SCM array) SCM_DEFINE (scm_array_length, "array-length", 1, 0, 0, (SCM array), - "Return the length of an array: the dimension of its first\n" - "dimension. It is an error to ask for the length of an\n" - "array of rank 0.") + "Return the length of an array: its first dimension.\n" + "It is an error to ask for the length of an array of rank 0.") #define FUNC_NAME s_scm_array_rank { return scm_from_size_t (scm_c_array_length (array)); |