functions.
* fixed bug: the #S reader macro performs the keyword coercion
specified for slot names. (reported by Kalle Niemitalo)
+ * fixed bug: lambda lists may contain symbols whose names start with
+ & but are not lambda-list-keywords; their occurrence triggers a
+ STYLE-WARNING.
* optimization: rearranged the expansion of various defining macros
so that each expands into only one top-level form in a
:LOAD-TOPLEVEL context; this appears to decrease fasl sizes by
:required :rest)
state))
(dolist (arg list)
- (if (and (symbolp arg)
- (let ((name (symbol-name arg)))
- (and (plusp (length name))
- (char= (char name 0) #\&))))
+ (if (member arg sb!xc:lambda-list-keywords)
(case arg
(&optional
(unless (eq state :required)
(compiler-error "misplaced &AUX in lambda list: ~S" list))
(setq auxp t
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)))))
+ (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))))))
(when (eq state :rest)
(compiler-error "&REST without rest variable"))
(assert (= &key 3))
(assert (null &allow-other-keys)))
+(let ((fn (lambda (&foo &rest &bar) (cons &foo &bar))))
+ (assert (equal (funcall fn 1) '(1)))
+ (assert (equal (funcall fn 1 2 3) '(1 2 3))))
+
;;; success
(quit :unix-status 104)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.10.49"
+"0.8.10.50"