1.0.16.33: UNION and NUNION work with :TEST-NOT again
authorNikodemus Siivola <nikodemus@random-state.net>
Fri, 16 May 2008 06:55:05 +0000 (06:55 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Fri, 16 May 2008 06:55:05 +0000 (06:55 +0000)
 * Patch by Eric Marsden. Broken at 1.0.9.1 by yours truly.

NEWS
src/code/list.lisp
tests/compiler.pure.lisp
tests/list.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 18d415f..db3a9d3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,8 @@ changes in sbcl-1.0.17 relative to 1.0.16:
     in normal SPEED policies.
   * optimization: NCONC no longer needs to heap cons its &REST list
     in normal SPEED policies.
+  * bug fix: UNION and NUNION work with :TEST-NOT once more,
+    regression since 1.0.9.1. (thanks to Eric Marsden)
   * bug fix: result of MAKE-ARRAY can be stack allocated - regression
     since 1.0.15.36. (thanks to Paul Khuong)
   * bug fix: LAST when always returned the whole list when given a bignum
index 551420d..045e1de 100644 (file)
         (key (and key (%coerce-callable-to-fun key)))
         (test (if notp
                   (let ((test-not-fun (%coerce-callable-to-fun test-not)))
-                    (lambda (x) (not (funcall test-not-fun x))))
+                    (lambda (x y) (not (funcall test-not-fun x y))))
                   (%coerce-callable-to-fun test))))
     (multiple-value-bind (short long n-short)
         (if (< n1 n2)
         (key (and key (%coerce-callable-to-fun key)))
         (test (if notp
                   (let ((test-not-fun (%coerce-callable-to-fun test-not)))
-                    (lambda (x) (not (funcall test-not-fun x))))
+                    (lambda (x y) (not (funcall test-not-fun x y))))
                   (%coerce-callable-to-fun test))))
     (multiple-value-bind (short long n-short)
         (if (< n1 n2)
index 9b5289d..f14cbdf 100644 (file)
 ;;;
 ;;; no :MOVE-ARG VOP defined to move #<SB-C:TN t1> (SC SB-VM::SINGLE-REG) to #<SB-C:TN t2> (SC SB-VM::ANY-REG)
 ;;;    [Condition of type SIMPLE-ERROR]
-(compile nil 
+(compile nil
          '(lambda (frob)
-           (labels 
+           (labels
                ((%zig (frob)
                   (typecase frob
                     (double-float
index 921500d..555b0c2 100644 (file)
                                         (declare (optimize speed))
                                         (adjoin elt '(:y))))
                          ':x)))
+
+
+(macrolet ((test (expected list-1 list-2 &rest args)
+             `(progn
+                (assert (equal ,expected (funcall #'union ,list-1 ,list-2 ,@args)))
+                (assert (equal ,expected (funcall #'nunion
+                                                  (copy-list ,list-1)
+                                                  (copy-list ,list-2)
+                                                  ,@args))))))
+  (test nil nil nil)
+  (test '(42) nil '(42))
+  (test '(42) '(42) nil)
+  (test '(42) '(42) '(42))
+  (test '((42) (42)) '((42)) '((42)))
+  (test '((42) (42)) '((42)) '((42)) :test-not #'equal)
+  (test '((42)) '((42)) '((42)) :test #'equal)
+  (test '((42)) '((42)) '((42)) :key #'car)
+  (test '((42)) '((42)) '((42)) :key #'car :test-not #'<))
+
index b56b2e5..096d1e7 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.16.32"
+"1.0.16.33"