[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, master, updated. release_1-9-9-51-ge48
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, master, updated. release_1-9-9-51-ge48a2f8 |
Date: |
Wed, 07 Apr 2010 19:02:59 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=e48a2f8705623e23c21dca5bb38ab437d82b39e4
The branch, master has been updated
via e48a2f8705623e23c21dca5bb38ab437d82b39e4 (commit)
from f5318d8b188c6636d1f593bb1d2690ba1b0a42e4 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e48a2f8705623e23c21dca5bb38ab437d82b39e4
Author: Andy Wingo <address@hidden>
Date: Wed Apr 7 21:04:37 2010 +0200
add docs and tests for array->list
* libguile/generalized-arrays.c (scm_array_to_list): Add docs.
* test-suite/tests/arrays.test ("array->list"): Add tests.
-----------------------------------------------------------------------
Summary of changes:
libguile/generalized-arrays.c | 10 ++++++++--
test-suite/tests/arrays.test | 11 +++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/libguile/generalized-arrays.c b/libguile/generalized-arrays.c
index ff05151..a04b5fa 100644
--- a/libguile/generalized-arrays.c
+++ b/libguile/generalized-arrays.c
@@ -250,8 +250,14 @@ array_to_list (scm_t_array_handle *h, size_t dim, unsigned
long pos)
SCM_DEFINE (scm_array_to_list, "array->list", 1, 0, 0,
(SCM array),
- "FIXME description a list consisting of all the elements, in order,
of\n"
- "@var{array}.")
+ "Return a list representation of @var{array}.\n\n"
+ "It is easiest to specify the behavior of this function by\n"
+ "example:\n"
+ "@example\n"
+ "(array->list #0(a)) @result{} 1\n"
+ "(array->list #1(a b)) @result{} (a b)\n"
+ "(array->list #2((aa ab) (ba bb)) @result{} ((aa ab) (ba bb))\n"
+ "@end example\n")
#define FUNC_NAME s_scm_array_to_list
{
scm_t_array_handle h;
diff --git a/test-suite/tests/arrays.test b/test-suite/tests/arrays.test
index 2ce961b..b762f20 100644
--- a/test-suite/tests/arrays.test
+++ b/test-suite/tests/arrays.test
@@ -207,6 +207,17 @@
(array-equal? #s16(1 2 3) #s16(1 2 3))))
;;;
+;;; array->list
+;;;
+
+(with-test-prefix "array->list"
+ (pass-if (equal? (array->list #s16(1 2 3)) '(1 2 3)))
+ (pass-if (equal? (array->list #(1 2 3)) '(1 2 3)))
+ (pass-if (equal? (array->list #2((1 2) (3 4) (5 6))) '((1 2) (3 4) (5 6))))
+ (pass-if (equal? (array->list #()) '())))
+
+
+;;;
;;; array-fill!
;;;
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, master, updated. release_1-9-9-51-ge48a2f8,
Andy Wingo <=