diff options
author | Andy Wingo <wingo@pobox.com> | 2010-04-01 00:18:44 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-04-01 00:25:06 +0200 |
commit | a587d6a97338a0fd62173e60581ff07f55ec2042 (patch) | |
tree | e11f29648cbd5efcfeeec2d698f1e7065a894401 /libguile/bytevectors.c | |
parent | 92d33877d9f8523eaebab75373a30f161e6cc1e8 (diff) | |
download | guile-a587d6a97338a0fd62173e60581ff07f55ec2042.tar.gz |
more fixes to equal? for arrays
* libguile/array-map.c (array_compare, scm_array_equal_p): Rewrite as
something that operates on the generic array handle infrastructure.
Based on array->list.
(scm_i_array_equal_p): Change the docs, as array-equal? is now the same
as equal?, except that it typechecks its args.
* doc/ref/api-compound.texi (Array Procedures): Update array-equal?
docs.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_raequal): Deprecate.
* libguile/bytevectors.c (scm_bytevector_eq_p): Bugfix: bytevectors are
bytevector=? only if their element type is the same.
* libguile/eq.c (scm_equal_p): Only dispatch to scm_array_equal_p if
both args are arrays (generically).
* test-suite/tests/arrays.test ("equal?"): Add some more tests.
Diffstat (limited to 'libguile/bytevectors.c')
-rw-r--r-- | libguile/bytevectors.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libguile/bytevectors.c b/libguile/bytevectors.c index f3a61c1d0..853a3cf9a 100644 --- a/libguile/bytevectors.c +++ b/libguile/bytevectors.c @@ -511,7 +511,8 @@ SCM_DEFINE (scm_bytevector_eq_p, "bytevector=?", 2, 0, 0, c_len1 = SCM_BYTEVECTOR_LENGTH (bv1); c_len2 = SCM_BYTEVECTOR_LENGTH (bv2); - if (c_len1 == c_len2) + if (c_len1 == c_len2 && (SCM_BYTEVECTOR_ELEMENT_TYPE (bv1) + == SCM_BYTEVECTOR_ELEMENT_TYPE (bv2))) { signed char *c_bv1, *c_bv2; |