From 8569c8e2da3bb1ced48ef25c527e808f756b9207 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 20 Jul 2013 00:29:24 +0200 Subject: Simplify. --- sb-eval2.lisp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sb-eval2.lisp b/sb-eval2.lisp index 6b1906c..9ffda51 100644 --- a/sb-eval2.lisp +++ b/sb-eval2.lisp @@ -488,14 +488,13 @@ ;; All this ELT and LENGTH stuff is not as ;; inefficient as it looks. SBCL transforms ;; &rest into &more here. - (let* ((restnum 0) - (rest + (let* ((rest (when (or restp keyp) (loop for i from (+ required-num optional-num) below (length args) - collect (elt args i) - do (incf restnum)))) + collect (elt args i)))) + (restnum (- (length args) (+ required-num optional-num))) (keys-checked-p nil) (my-default-values* default-values*) (my-keywords keywords) @@ -574,9 +573,8 @@ allowp (getf rest :allow-other-keys nil)) (loop for (k v) on rest by #'cddr - unless (member k - (cons :allow-other-keys keywords) - :test #'eq) + unless (or (eq k :allow-other-keys) + (member k keywords :test #'eq)) do (error 'sb-int:simple-program-error :format-control "unknown &KEY argument: ~A" :format-arguments (list k))) @@ -626,7 +624,6 @@ (lambda (env) (lambda (&rest args) (declare (dynamic-extent args)) - ;;XXX VARNUM is too big--- need only lexicals (with-dynamic-extent-environment (*new-env* env varnum) (declare (special *new-env*)) (apply #'handle-arguments args)))))))))))) -- cgit v1.2.3