summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorDaniel Llorens <daniel.llorens@bluewin.ch>2016-11-18 16:23:05 +0100
committerDaniel Llorens <daniel.llorens@bluewin.ch>2016-11-23 13:05:49 +0100
commitfa4a22971a122e30e6b167bfe7ac209d02ffafc4 (patch)
treee89cbfa9d6f5ce3bdae7f1725971cf697e3ced18 /test-suite
parent0bd7562c961223cd70e772bac8b7ae21b34f1aed (diff)
Deprecate scm_from_contiguous_array
scm_from_contiguous_array() was undocumented, unused within Guile, and can be replaced by make-array + array-copy! without requiring contiguity and without loss of performance. * libguile/arrays.c (scm_array_contents): Do not rely on SCM_I_ARRAY_CONTP. * test-suite/tests/arrays.test: Test array-contents with 0-rank array. * libguile/arrays.h: Declare scm_i_shap2ra(), SCM_SET_ARRAY_CONTIGUOUS_FLAG, SCM_CLR_ARRAY_CONTIGUOUS_FLAG so that scm_from_contiguous_array() can keep using them. * libguile/deprecated.c (scm_from_contiguous_array): Move here from arrays.c. * libguile/deprecated.h (scm_from_contiguous_array): Deprecate. * NEWS: Add deprecation notice.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/tests/arrays.test6
1 files changed, 6 insertions, 0 deletions
diff --git a/test-suite/tests/arrays.test b/test-suite/tests/arrays.test
index 57c5cef3e..4c943dd41 100644
--- a/test-suite/tests/arrays.test
+++ b/test-suite/tests/arrays.test
@@ -413,6 +413,12 @@
(with-test-prefix/c&e "array-contents"
+ (pass-if "0-rank array"
+ (let ((a (make-vector 1 77)))
+ (and
+ (eq? a (array-contents (make-shared-array a (const '(0)))))
+ (eq? a (array-contents (make-shared-array a (const '(0))) #t)))))
+
(pass-if "simple vector"
(let* ((a (make-array 0 4)))
(eq? a (array-contents a))))