X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Fparse-lambda-list.lisp;h=85325e32ef4782c6cf0c77073ae0abbc3aac112f;hb=24bc431a3403af05c5df601d09c0d0c27cb500b2;hp=9628902b6f8c04268a0d946a8872c87786c26c6f;hpb=ce02ab2ecd9c6ae2e570abd8c93ebf3be55bbdad;p=sbcl.git diff --git a/src/compiler/parse-lambda-list.lisp b/src/compiler/parse-lambda-list.lisp index 9628902..85325e3 100644 --- a/src/compiler/parse-lambda-list.lisp +++ b/src/compiler/parse-lambda-list.lisp @@ -14,9 +14,9 @@ ;;; Break a lambda list into its component parts. We return eleven ;;; values: ;;; 1. a list of the required args; -;;; 2. a list of the optional arg specs; -;;; 3. true if a rest arg was specified; -;;; 4. the &rest arg; +;;; 2. a list of the &OPTIONAL arg specs; +;;; 3. true if a &REST arg was specified; +;;; 4. the &REST arg; ;;; 5. true if &KEY args are present; ;;; 6. a list of the &KEY arg specs; ;;; 7. true if &ALLOW-OTHER-KEYS was specified.; @@ -25,7 +25,7 @@ ;;; 10. the &MORE context var; ;;; 11. the &MORE count var. ;;; -;;; The top-level lambda list syntax is checked for validity, but the +;;; The top level lambda list syntax is checked for validity, but the ;;; arg specifiers are just passed through untouched. If something is ;;; wrong, we use COMPILER-ERROR, aborting compilation to the last ;;; recovery point. @@ -68,7 +68,7 @@ (unless (member state '(:required :optional)) (compiler-error "misplaced &REST in lambda list: ~S" list)) (setq state :rest)) - (sb!c:&more + (&more (unless (member state '(:required :optional)) (compiler-error "misplaced &MORE in lambda list: ~S" list)) (setq morep t @@ -114,7 +114,9 @@ (compiler-error "found garbage in lambda list when expecting ~ a keyword: ~S" arg))))) - + (when (eq state :rest) + (compiler-error "&REST without rest variable")) + (values (required) (optional) restp rest keyp (keys) allowp (aux) morep more-context more-count))))