From 44feceaf16073bf8ef7f2c03d5b99eb1c4d93162 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 20 Jul 2013 17:56:20 +0200 Subject: LAMBDA: Deal properly with &REST lists in the presence of missing &OPTIONAL arguments. --- sb-eval2.lisp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sb-eval2.lisp b/sb-eval2.lisp index 1a58111..0e1e197 100644 --- a/sb-eval2.lisp +++ b/sb-eval2.lisp @@ -536,7 +536,7 @@ from (+ required-num optional-num) below (length args) collect (elt args i)))) - (restnum (- (length args) (+ required-num optional-num))) + (restnum (max 0 (- (length args) (+ required-num optional-num)))) (keys-checked-p nil) (my-default-values* default-values*) (my-keywords keywords) @@ -611,7 +611,7 @@ (go aux)) (unless (evenp restnum) (error 'sb-int:simple-program-error - :format-control "odd number of keyword arguments: ~D" + :format-control "odd number of keyword arguments: ~S" :format-arguments (list rest))) (when (>= i (the fixnum -- cgit v1.2.3