Improve error message for NAMED option without TYPE option.
authorChris Hanson <org/chris-hanson/cph>
Wed, 17 Mar 1993 04:04:25 +0000 (04:04 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 17 Mar 1993 04:04:25 +0000 (04:04 +0000)
v7/src/runtime/defstr.scm

index af304271b84645695f6838198879e38fb3e7cc47..55d486ed67ceaca375712b60ca921aa4138bfc5f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: defstr.scm,v 14.23 1993/03/07 20:56:20 cph Exp $
+$Id: defstr.scm,v 14.24 1993/03/17 04:04:25 cph Exp $
 
 Copyright (c) 1988-93 Massachusetts Institute of Technology
 
@@ -263,13 +263,13 @@ differences:
          (named-seen? (assq 'NAMED options-seen)))
       (let ((named? (or (not type-seen?) named-seen?)))
        (if (not type-seen?)
-           (begin
-             (if (and named-seen? (not type-name))
-                 (error "Illegal structure option:" (cdr named-seen?)))
-             (let ((initial-offset-seen? (assq 'INITIAL-OFFSET options-seen)))
-               (if initial-offset-seen?
-                   (error "Structure option illegal without TYPE option:"
-                          (cdr initial-offset-seen?))))))
+           (let ((check-option
+                  (lambda (seen?)
+                    (if seen?
+                        (error "Structure option illegal without TYPE option:"
+                               (cdr seen?))))))
+             (check-option (and (not type-name) named-seen?))
+             (check-option (assq 'INITIAL-OFFSET options-seen))))
        (if (not named?)
            (let ((check
                   (lambda (option-seen)