From: Alfredo Beaumont Date: Sun, 12 May 2013 11:59:17 +0000 (+0200) Subject: sublis: take sanity check out of recursive function X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=31f9fc1657de176780b247f49252a79efe72a01a;p=jscl.git sublis: take sanity check out of recursive function --- diff --git a/src/list.lisp b/src/list.lisp index 45aee57..9a445db 100644 --- a/src/list.lisp +++ b/src/list.lisp @@ -100,9 +100,9 @@ (defun cddddr (x) (cdr (cdddr x))) (defun sublis (alist tree &key key (test #'eql testp) (test-not #'eql test-not-p)) + (when (and testp test-not-p) + (error "Both test and test-not are set")) (labels ((s (tree) - (when (and testp test-not-p) - (error "Both test and test-not are set")) (let* ((key-val (if key (funcall key tree) tree)) (replace (if test-not-p (assoc key-val alist :test-not test-not)