X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fparse-lambda-list.lisp;h=affb94d95dd0bb0b4506bb89292f2b53dfc34bcf;hb=d0566445e2546a2e159a24e4e28c82bab648b786;hp=64e5838c2423829e0a896f065c57282dea434732;hpb=9ca04e5fe7bc37286c120bc84cfd4abf05e51327;p=sbcl.git diff --git a/src/compiler/parse-lambda-list.lisp b/src/compiler/parse-lambda-list.lisp index 64e5838..affb94d 100644 --- a/src/compiler/parse-lambda-list.lisp +++ b/src/compiler/parse-lambda-list.lisp @@ -34,7 +34,7 @@ ;;; arg specifiers are just passed through untouched. If something is ;;; wrong, we use COMPILER-ERROR, aborting compilation to the last ;;; recovery point. -(declaim (ftype (sfunction (list) +(declaim (ftype (sfunction (list &key (:silent boolean)) (values list list boolean t boolean list boolean boolean list boolean t t boolean)) parse-lambda-list-like-thing)) @@ -42,7 +42,7 @@ (values list list boolean t boolean list boolean boolean list boolean t t)) parse-lambda-list)) -(defun parse-lambda-list-like-thing (list) +(defun parse-lambda-list-like-thing (list &key silent) (collect ((required) (optional) (keys) @@ -86,8 +86,9 @@ (compiler-error "misplaced &KEY in lambda list: ~S" list)) #-sb-xc-host (when (optional) - (compiler-style-warn - "&OPTIONAL and &KEY found in the same lambda list: ~S" list)) + (unless silent + (compiler-style-warn + "&OPTIONAL and &KEY found in the same lambda list: ~S" list))) (setq keyp t state :key)) (&allow-other-keys @@ -105,10 +106,12 @@ (setq auxp t state :aux)) (t - ;; It could be argued that &WHOLE and friends would be just ordinary - ;; variables in an ordinary lambda-list, but since (1) it seem exceedingly - ;; unlikely that that was that the programmer actually ment (2) the spec - ;; can be interpreted as giving as licence to signal an error[*] we do. + ;; It could be argued that &WHOLE and friends would be + ;; just ordinary variables in an ordinary lambda-list, + ;; but since (1) that seem exceedingly to have been the + ;; programmers intent and (2) the spec can be + ;; interpreted as giving as licence to signal an + ;; error[*] that is what we do. ;; ;; [* All lambda list keywords used in the ;; implementation appear in LAMBDA-LIST-KEYWORDS. Each @@ -124,8 +127,10 @@ (let ((name (symbol-name arg))) (when (and (plusp (length name)) (char= (char name 0) #\&)) - (style-warn - "suspicious variable in lambda list: ~S." arg)))) + ;; Should this be COMPILER-STYLE-WARN? + (unless silent + (style-warn + "suspicious variable in lambda list: ~S." arg))))) (case state (:required (required arg)) (:optional (optional arg))