Changeset 11835
- Timestamp:
- 05/06/09 18:34:40 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r11833 r11835 1002 1002 ;; functions with a wrong number of arguments or malformed keyword argument 1003 1003 ;; lists, and using unrecognized declaration specifiers." (3.2.5) 1004 (defknown check-arg-count (t fixnum) t) 1005 (defun check-arg-count (form n) 1004 (defun check-number-of-args (form n &optional (minimum nil)) 1006 1005 (declare (type fixnum n)) 1007 1006 (let* ((op (car form)) 1008 1007 (args (cdr form)) 1009 (ok (= (length args) n))) 1008 (ok (if minimum 1009 (>= (length args) n) 1010 (= (length args) n)))) 1010 1011 (declare (type boolean ok)) 1011 1012 (unless ok … … 1013 1014 #'compiler-warn ; See above! 1014 1015 #'compiler-style-warn) 1015 "Wrong number of arguments for ~A (expected ~D, but received ~D)."1016 op n (length args)))1016 "Wrong number of arguments for ~A (expected~:[~; at least~] ~D, but received ~D)." 1017 op minimum n (length args))) 1017 1018 ok)) 1019 1020 (defknown check-arg-count (t fixnum) t) 1021 (defun check-arg-count (form n) 1022 (check-number-of-args form n)) 1018 1023 1019 1024 (declaim (ftype (function (t fixnum) t) check-min-args)) 1020 1025 (defun check-min-args (form n) 1021 (declare (type fixnum n)) 1022 (let* ((op (car form)) 1023 (args (cdr form)) 1024 (ok (>= (length args) n))) 1025 (unless ok 1026 (funcall (if (eq (symbol-package op) +cl-package+) 1027 #'compiler-warn ; See above! 1028 #'compiler-style-warn) 1029 "Wrong number of arguments for ~A (expected at least ~D, but received ~D)." 1030 op n (length args))) 1031 ok)) 1026 (check-number-of-args form n t)) 1032 1027 1033 1028 (defun unsupported-opcode (instruction)
Note: See TracChangeset
for help on using the changeset viewer.