From 9cafc84b9f5a885d622db5909d5bc8e2b87f4cd5 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Mon, 28 Apr 2008 21:48:39 +0000 Subject: [PATCH] 1.0.16.12: revert ADJOIN change from 1.0.16.5 * The correct expansion is a bit too hairy to implement nicely with a compiler macro. * Test-cases. Second take using TRANSFORM-LIST-ITEM-SEEK coming after the freeze. --- NEWS | 2 -- src/code/list.lisp | 10 +--------- tests/list.pure.lisp | 7 +++++++ version.lisp-expr | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index c1bef9e..720f6bb 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,5 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-1.0.17 relative to 1.0.16: - * optimization: ADJOIN and PUSHNEW are upto ~70% faster in normal - SPEED policies. * optimization: APPEND is upto ~10% faster in normal SPEED policies. * optimization: two argument forms of LAST are upto ~10% faster in normal SPEED policies. diff --git a/src/code/list.lisp b/src/code/list.lisp index 5d32950..4d03a1a 100644 --- a/src/code/list.lisp +++ b/src/code/list.lisp @@ -18,7 +18,7 @@ ;;;; -- WHN 20000127 (declaim (maybe-inline - tree-equal nth %setnth nthcdr make-list + adjoin tree-equal nth %setnth nthcdr make-list member-if member-if-not tailp union nunion intersection nintersection set-difference nset-difference set-exclusive-or nset-exclusive-or subsetp acons @@ -857,14 +857,6 @@ list (cons item list)))) -(define-compiler-macro adjoin (item list &rest keys) - (with-unique-names (n-item n-list) - `(let ((,n-item ,item) - (,n-list ,list)) - (if (member ,n-item ,n-list ,@keys) - ,n-list - (cons ,n-item ,n-list))))) - (defconstant +list-based-union-limit+ 80) (defun union (list1 list2 &key key (test #'eql testp) (test-not nil notp)) diff --git a/tests/list.pure.lisp b/tests/list.pure.lisp index b018b3e..66882ea 100644 --- a/tests/list.pure.lisp +++ b/tests/list.pure.lisp @@ -243,3 +243,10 @@ (assert (not res)) (assert (typep err 'sb-kernel:bounding-indices-bad-error)))) +;;; ADJOIN must apply key to item as well +(assert (equal '((:b)) (funcall + (compile nil '(lambda (x y) (adjoin x y :key #'car :test #'string=))) + (list 'b) (list '(:b))))) +(assert (equal '((:b)) + (let ((sb-ext:*evaluator-mode* :interpret)) + (eval '(adjoin (list 'b) (list '(:b)) :key #'car :test #'string=))))) diff --git a/version.lisp-expr b/version.lisp-expr index 8fff13c..f7104fe 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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.11" +"1.0.16.12" -- 1.7.10.4