guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-9-24-g9d0


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-9-24-g9d031d4
Date: Tue, 30 Mar 2010 19:21:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=9d031d4d575ac8f343a5d984cb02cd374577c5a9

The branch, master has been updated
       via  9d031d4d575ac8f343a5d984cb02cd374577c5a9 (commit)
      from  6128f34c4b6ae713c4dddc38093aafe7260ccab6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9d031d4d575ac8f343a5d984cb02cd374577c5a9
Author: Andy Wingo <address@hidden>
Date:   Tue Mar 30 21:23:06 2010 +0200

    fix equal? between an array and a non-array
    
    * libguile/eq.c (scm_equal_p): Only call scm_array_equal_p if both
      arguments are generalized arrays; otherwise they are not equal. Thanks
      to Daniel Llorens del Río for the tip.
    
    * test-suite/Makefile.am:
    * test-suite/tests/arrays.test: Add a test.

-----------------------------------------------------------------------

Summary of changes:
 libguile/eq.c                                      |    2 +-
 test-suite/Makefile.am                             |    1 +
 .../arrays.scm => test-suite/tests/arrays.test     |   17 +++++++++--------
 3 files changed, 11 insertions(+), 9 deletions(-)
 copy module/ice-9/arrays.scm => test-suite/tests/arrays.test (73%)

diff --git a/libguile/eq.c b/libguile/eq.c
index 6a533da..923fa77 100644
--- a/libguile/eq.c
+++ b/libguile/eq.c
@@ -321,7 +321,7 @@ scm_equal_p (SCM x, SCM y)
 
       /* Vectors can be equal to one-dimensional arrays.
        */
-      if (SCM_I_ARRAYP (x) || SCM_I_ARRAYP (y))
+      if (scm_is_array (x) && scm_is_array (y))
        return scm_array_equal_p (x, y);
 
       return SCM_BOOL_F;
diff --git a/test-suite/Makefile.am b/test-suite/Makefile.am
index 36afa25..40f5a98 100644
--- a/test-suite/Makefile.am
+++ b/test-suite/Makefile.am
@@ -24,6 +24,7 @@ SUBDIRS = standalone
 SCM_TESTS = tests/alist.test                   \
            tests/and-let-star.test             \
            tests/arbiters.test                 \
+           tests/arrays.test                   \
            tests/asm-to-bytecode.test          \
            tests/bit-operations.test           \
            tests/brainfuck.test                \
diff --git a/module/ice-9/arrays.scm b/test-suite/tests/arrays.test
similarity index 73%
copy from module/ice-9/arrays.scm
copy to test-suite/tests/arrays.test
index f7f9e5e..30dc750 100644
--- a/module/ice-9/arrays.scm
+++ b/test-suite/tests/arrays.test
@@ -1,7 +1,7 @@
-;;; installed-scm-file
-
-;;;; Copyright (C) 1999, 2001, 2004, 2006 Free Software Foundation, Inc.
-;;;; 
+;;;; arrays.test --- tests guile's arrays     -*- scheme -*-
+;;;;
+;;;; Copyright 2010 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
 ;;;; License as published by the Free Software Foundation; either
@@ -15,8 +15,9 @@
 ;;;; 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
-;;;; 
 
-(define (array-shape a)
-  (map (lambda (ind) (if (number? ind) (list 0 (+ -1 ind)) ind))
-       (array-dimensions a)))
+(define-module (test-suite test-unif)
+  #:use-module (test-suite lib))
+
+(pass-if "equal? on array and non-array"
+  (not (equal? #2f64((0 1) (2 3)) 100)))


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]