1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* 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.
This commit is contained in:
Marius Vollmer 2006-05-29 21:54:13 +00:00
parent 18bffcd0f7
commit af4f861210
5 changed files with 27 additions and 0 deletions

4
NEWS
View file

@ -14,6 +14,10 @@ Each release reports the NEWS in the following sections:
Changes in 1.8.1:
* Changes to Scheme functions and syntax
** A one-dimenisonal array can now be 'equal?' to a vector.
* Bug fixes.
** array-set! with bit vector.
** string<? and friends follow char<? etc order on 8-bit chars.

View file

@ -1,3 +1,9 @@
2006-05-30 Marius Vollmer <mvo@zagadka.de>
* 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.
2006-05-29 Marius Vollmer <mvo@zagadka.de>
* throw.c (scm_ithrow): When looking for the jmpbuf, first test

View file

@ -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))

View file

@ -1,3 +1,7 @@
2006-05-30 Marius Vollmer <mvo@zagadka.de>
* tests/unif.test ("vector equal? one-dimensional array"): New.
2006-05-28 Marius Vollmer <mvo@zagadka.de>
* tests/ports.test, tests/filesys.test: Delete test file after all

View file

@ -512,3 +512,11 @@
(begin
(array-set! a -128 0)
(= -128 (uniform-vector-ref a 0)))))))
;;; equal? with vector and one-dimensional array
(pass-if "vector equal? one-dimensional array"
(equal? (make-shared-array #2((a b c) (d e f) (g h i))
(lambda (i) (list i i))
'(0 2))
#(a e i)))