From 65aceb5698c2cf55e1862c2a40df402296d98d45 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 18 Jul 2013 17:30:56 +0200 Subject: LAMBDA: Raise SIMPLE-PROGRAM-ERRORs for argument number mismatches. --- sb-eval2.lisp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sb-eval2.lisp') 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))))) -- cgit v1.2.3