X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Flist.lisp;h=c0370b77f65ab65e47c6dbdcc974793ec851e8e0;hb=dc0c7df5c3abdcde2f770ee7f379da3d32fb97d6;hp=96a359480abada1bf41dbbfe73fd02e5f4ec7890;hpb=8f59cd56540bb3699c80c141f30968cb0126ce04;p=jscl.git diff --git a/src/list.lisp b/src/list.lisp index 96a3594..c0370b7 100644 --- a/src/list.lisp +++ b/src/list.lisp @@ -200,23 +200,27 @@ (and (consp (cdr x)) (cons (car x) (butlast (cdr x))))) -(defun member (x list &key (key #'identity) (test #'eql)) +(defun member (x list &key key (test #'eql testp) (test-not #'eql test-not-p)) (while list - (when (funcall test x (funcall key (car list))) + (when (satisfies-test-p x (car list) :key key :test test :testp testp + :test-not test-not :test-not-p test-not-p) (return list)) (setq list (cdr list)))) -(defun assoc (x alist &key (test #'eql)) +(defun assoc (x alist &key key (test #'eql testp) (test-not #'eql test-not-p)) (while alist - (if (funcall test x (caar alist)) + (if (satisfies-test-p x (caar alist) :key key :test test :testp testp + :test-not test-not :test-not-p test-not-p) (return) (setq alist (cdr alist)))) (car alist)) -(defun rassoc (x alist &key (test #'eql)) +(defun rassoc (x alist &key key (test #'eql) (test #'eql testp) + (test-not #'eql test-not-p)) (while alist - (if (funcall test x (cdar alist)) + (if (satisfies-test-p x (cdar alist) :key key :test test :testp testp + :test-not test-not :test-not-p test-not-p) (return) (setq alist (cdr alist)))) (car alist))