+(defun lambda-check-argument-count
+ (n-required-arguments n-optional-arguments rest-p)
+ ;; Note: Remember that we assume that the number of arguments of a
+ ;; call is at least 1 (the values argument).
+ (let ((min (1+ n-required-arguments))
+ (max (if rest-p 'n/a (+ 1 n-required-arguments n-optional-arguments))))
+ (block nil
+ ;; Special case: a positive exact number of arguments.
+ (when (and (< 1 min) (eql min max))
+ (return (concat "checkArgs(arguments, " (integer-to-string min) ");" *newline*)))
+ ;; General case:
+ (concat
+ (if (< 1 min)
+ (concat "checkArgsAtLeast(arguments, " (integer-to-string min) ");" *newline*)
+ "")
+ (if (numberp max)
+ (concat "checkArgsAtMost(arguments, " (integer-to-string max) ");" *newline*)
+ "")))))
+
+(defun compile-lambda (lambda-list body)