diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2013-07-18 17:30:56 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2013-07-18 17:30:56 +0200 |
commit | 65aceb5698c2cf55e1862c2a40df402296d98d45 (patch) | |
tree | b24e83bcfd3f0cde0e5530587aa20a05edc5e9fa | |
parent | 3241feaf8315c7aa04d7d914480472e016134a40 (diff) |
LAMBDA: Raise SIMPLE-PROGRAM-ERRORs for argument number mismatches.
-rw-r--r-- | sb-eval2.lisp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sb-eval2.lisp b/sb-eval2.lisp index 2614bd3..eda3a60 100644 --- a/sb-eval2.lisp +++ b/sb-eval2.lisp @@ -446,7 +446,9 @@ (incf argi) (go positional) missing-optionals - (assert (>= argi required-num)) + (unless (>= argi required-num) + (error 'sb-int:simple-program-error + :format-arguments "invalid number of arguments: ~D" (length args))) (when (>= vari (the fixnum (+ required-num (the fixnum (* 2 optional-num))))) (go keys)) (let ((val* (pop my-default-values*))) @@ -458,9 +460,13 @@ (go missing-optionals) keys (unless keyp - (assert (or restp (= argi (length args)))) + (unless (or restp (= argi (length args))) + (error 'sb-int:simple-program-error + :format-arguments "invalid number of arguments: ~D" (length args))) (go aux)) - (assert (evenp restnum)) + (unless (evenp restnum) + (error 'sb-int:simple-program-error + :format-arguments "odd number of keyword arguments: ~D" rest)) (when (>= vari (the fixnum (+ required-num (* 2 (+ optional-num key-num))))) |