(let ((car-option (car option)))
(case car-option
(declare
+ (when (and
+ (consp (cadr option))
+ (member (first (cadr option))
+ ;; FIXME: this list is slightly weird.
+ ;; ANSI (on the DEFGENERIC page) in one
+ ;; place allows only OPTIMIZE; in
+ ;; another place gives this list of
+ ;; disallowed declaration specifiers.
+ ;; This seems to be the only place where
+ ;; the FUNCTION declaration is
+ ;; mentioned; TYPE seems to be missing.
+ ;; Very strange. -- CSR, 2002-10-21
+ '(declaration ftype function
+ inline notinline special)))
+ (error 'simple-program-error
+ :format-control "The declaration specifier ~S ~
+ is not allowed inside DEFGENERIC."
+ :format-arguments (list (cadr option))))
(push (cdr option) (initarg :declarations)))
((:argument-precedence-order :method-combination)
(if (initarg car-option)
(defmethod documentation ((x (eql '+)) y) "WRONG")
(assert (string= (documentation '+ 'function) answer)))
\f
+;;; only certain declarations are permitted in DEFGENERIC
+(macrolet ((assert-program-error (form)
+ `(multiple-value-bind (value error)
+ (ignore-errors ,form)
+ (assert (null value))
+ (assert (typep error 'program-error)))))
+ (assert-program-error (defgeneric bogus-declaration (x)
+ (declare (special y))))
+ (assert-program-error (defgeneric bogus-declaration2 (x)
+ (declare (notinline concatenate)))))
+\f
;;;; success
(sb-ext:quit :unix-status 104)
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.7.9.2"
+"0.7.9.3"