summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-20 17:56:20 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2013-07-20 17:56:20 +0200
commit44feceaf16073bf8ef7f2c03d5b99eb1c4d93162 (patch)
treed74bfd964b7169e6a1712371214b40e9008770e9
parent916638fbbd10a8921c2b70a4e6c2693c6101517b (diff)
LAMBDA: Deal properly with &REST lists in the presence of missing &OPTIONAL arguments.
-rw-r--r--sb-eval2.lisp4
1 files 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