mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-07-06 09:30:29 +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:
parent
18bffcd0f7
commit
af4f861210
5 changed files with 27 additions and 0 deletions
4
NEWS
4
NEWS
|
@ -14,6 +14,10 @@ Each release reports the NEWS in the following sections:
|
||||||
|
|
||||||
Changes in 1.8.1:
|
Changes in 1.8.1:
|
||||||
|
|
||||||
|
* Changes to Scheme functions and syntax
|
||||||
|
|
||||||
|
** A one-dimenisonal array can now be 'equal?' to a vector.
|
||||||
|
|
||||||
* Bug fixes.
|
* Bug fixes.
|
||||||
** array-set! with bit vector.
|
** array-set! with bit vector.
|
||||||
** string<? and friends follow char<? etc order on 8-bit chars.
|
** string<? and friends follow char<? etc order on 8-bit chars.
|
||||||
|
|
|
@ -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>
|
2006-05-29 Marius Vollmer <mvo@zagadka.de>
|
||||||
|
|
||||||
* throw.c (scm_ithrow): When looking for the jmpbuf, first test
|
* throw.c (scm_ithrow): When looking for the jmpbuf, first test
|
||||||
|
|
|
@ -257,6 +257,11 @@ SCM_PRIMITIVE_GENERIC_1 (scm_equal_p, "equal?", scm_tc7_rpsubr,
|
||||||
&& SCM_COMPLEX_IMAG (x) == 0.0);
|
&& 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;
|
return SCM_BOOL_F;
|
||||||
}
|
}
|
||||||
switch (SCM_TYP7 (x))
|
switch (SCM_TYP7 (x))
|
||||||
|
|
|
@ -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>
|
2006-05-28 Marius Vollmer <mvo@zagadka.de>
|
||||||
|
|
||||||
* tests/ports.test, tests/filesys.test: Delete test file after all
|
* tests/ports.test, tests/filesys.test: Delete test file after all
|
||||||
|
|
|
@ -512,3 +512,11 @@
|
||||||
(begin
|
(begin
|
||||||
(array-set! a -128 0)
|
(array-set! a -128 0)
|
||||||
(= -128 (uniform-vector-ref a 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)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue