0.7.7.4:
[sbcl.git] / src / compiler / parse-lambda-list.lisp
index 9628902..85325e3 100644 (file)
@@ -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
               (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))))