summaryrefslogtreecommitdiff
path: root/libguile/eq.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2006-05-29 21:54:13 +0000
committerMarius Vollmer <mvo@zagadka.de>2006-05-29 21:54:13 +0000
commitaf4f861210c83b08b1ddc503fdaa2acc9949a0fd (patch)
treef5e4bdc5865ad436f69b736e25b846a9a658db82 /libguile/eq.c
parent18bffcd0f7855b2406f1199d10eb3e2a381b16c2 (diff)
downloadguile-af4f861210c83b08b1ddc503fdaa2acc9949a0fd.tar.gz
* eq.c (scm_equal_p): Use scm_array_equal_p explicitely when one
of the arguments is a array. This allows vectors to be equal to one-dimensional arrays. * tests/unif.test ("vector equal? one-dimensional array"): New.
Diffstat (limited to 'libguile/eq.c')
-rw-r--r--libguile/eq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libguile/eq.c b/libguile/eq.c
index 4513b6b32..71d1acfa1 100644
--- a/libguile/eq.c
+++ b/libguile/eq.c
@@ -257,6 +257,11 @@ SCM_PRIMITIVE_GENERIC_1 (scm_equal_p, "equal?", scm_tc7_rpsubr,
&& SCM_COMPLEX_IMAG (x) == 0.0);
}
+ /* Vectors can be equal to one-dimensional arrays.
+ */
+ if (SCM_I_ARRAYP (x) || SCM_I_ARRAYP (y))
+ return scm_array_equal_p (x, y);
+
return SCM_BOOL_F;
}
switch (SCM_TYP7 (x))