- (setq state :aux))
- ;; FIXME: I don't think ANSI says this is an error. (It
- ;; should certainly be good for a STYLE-WARNING,
- ;; though.)
- (t
- (compiler-error "unknown &KEYWORD in lambda list: ~S" arg)))
- (case state
- (:required (required arg))
- (:optional (optional arg))
- (:rest
- (setq restp t
- rest arg
- state :post-rest))
- (:more-context
- (setq more-context arg
- state :more-count))
- (:more-count
- (setq more-count arg
- state :post-more))
- (:key (keys arg))
- (:aux (aux arg))
- (t
- (compiler-error "found garbage in lambda list when expecting ~
- a keyword: ~S"
- arg)))))
+ (when auxp
+ (compiler-error "multiple &AUX in lambda list: ~S" list))
+ (setq auxp t
+ state :aux))
+ (t (bug "unknown LAMBDA-LIST-KEYWORD in lambda list: ~S." arg)))
+ (progn
+ (when (symbolp arg)
+ (let ((name (symbol-name arg)))
+ (when (and (plusp (length name))
+ (char= (char name 0) #\&))
+ (style-warn
+ "suspicious variable in lambda list: ~S." arg))))
+ (case state
+ (:required (required arg))
+ (:optional (optional arg))
+ (:rest
+ (setq restp t
+ rest arg
+ state :post-rest))
+ (:more-context
+ (setq more-context arg
+ state :more-count))
+ (:more-count
+ (setq more-count arg
+ state :post-more))
+ (:key (keys arg))
+ (:aux (aux arg))
+ (t
+ (compiler-error "found garbage in lambda list when expecting ~
+ a keyword: ~S"
+ arg))))))