X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fsequence.lisp;h=6ac3ebfbe1e73bf3f5ec7b76739a127adad69fea;hb=f5ffe129c45d75d9f360d02d9b8823907b163347;hp=d7dae46b1b98c9656e9b675d03f8055b7b059879;hpb=c493bb2c2fed02d7cfb08599e6146de43e9a40d6;p=jscl.git diff --git a/src/sequence.lisp b/src/sequence.lisp index d7dae46..6ac3ebf 100644 --- a/src/sequence.lisp +++ b/src/sequence.lisp @@ -55,7 +55,7 @@ :test-not test-not :test-not-p test-not-p ) (return index)))) -(defun remove (x seq) +(defun remove (x seq &key key (test #'eql testp) (test-not #'eql test-not-p)) (cond ((null seq) nil) @@ -63,7 +63,8 @@ (let* ((head (cons nil nil)) (tail head)) (do-sequence (elt seq) - (unless (eql x elt) + (unless (satisfies-test-p x elt :key key :test test :testp testp + :test-not test-not :test-not-p test-not-p) (let ((new (list elt))) (rplacd tail new) (setq tail new)))) @@ -71,7 +72,8 @@ (t (let (vector) (do-sequence (elt seq index) - (if (eql x elt) + (if (satisfies-test-p x elt :key key :test test :testp testp + :test-not test-not :test-not-p test-not-p) ;; Copy the beginning of the vector only when we find an element ;; that does not match. (unless vector