-/* Copyright (C) 1995,1996,1997,1998,2000,2001,2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001,2003, 2004, 2006 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
\f
#include "libguile/unif.h"
#include "libguile/vectors.h"
+#include "libguile/struct.h"
+#include "libguile/goops.h"
+#include "libguile/objects.h"
+
#include "libguile/validate.h"
#include "libguile/eq.h"
\f
&& 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))
}
case scm_tc7_vector:
case scm_tc7_wvect:
- return scm_vector_equal_p (x, y);
+ return scm_i_vector_equal_p (x, y);
}
+
+ /* Check equality between structs of equal type (see cell-type test above)
+ that are not GOOPS instances. GOOPS instances are treated via the
+ generic function. */
+ if ((SCM_STRUCTP (x)) && (!SCM_INSTANCEP (x)))
+ return scm_i_struct_equalp (x, y);
+
generic_equal:
if (SCM_UNPACK (g_scm_equal_p))
return scm_call_generic_2 (g_scm_equal_p, x, y);