;;;; -*- 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.
;;;; -- 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
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))
(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=)))))
;;; 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"