Eliminate a bunch of now-unused classifier procedures.
authorChris Hanson <org/chris-hanson/cph>
Sat, 3 Mar 2018 18:58:32 +0000 (10:58 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sat, 3 Mar 2018 18:58:32 +0000 (10:58 -0800)
src/runtime/mit-syntax.scm
src/runtime/runtime.pkg
src/runtime/syntax.scm

index cdb9a4701ffbbf085a0820a287465a582a8948a9..3c8734bb6a3c874183a9b6d06dd4471552b8dd10 100644 (file)
@@ -35,7 +35,10 @@ USA.
                                transformer->expander-name)
   (lambda (form senv hist)
     (scheck '(_ expression) form senv hist)
-    (let ((transformer (compile-expr-item (classify-form-cadr form senv hist))))
+    (let ((transformer
+          (compile-expr-item (classify-form (cadr form)
+                                            senv
+                                            (hist-cadr hist)))))
       (transformer->keyword-item
        (transformer-eval transformer senv)
        senv
index c09b6131daeca0e638c84271fb307e2a5e328954..f8b2d5c40b8c61002a2f02bcf3123ec2ee622616 100644 (file)
@@ -4422,16 +4422,7 @@ USA.
          biselector:cr
          classifier->keyword
          classify-form
-         classify-form-cadddr
-         classify-form-caddr
-         classify-form-cadr
-         classify-form-car
-         classify-forms-cdr
-         classify-forms-in-order-cddr
-         classify-forms-in-order-cdr
-         classify-subform
          error:syntax
-         hist-caddr
          hist-cadr
          hist-car
          hist-cddr
index d0be31fdfddd9639a54c41bda5b800a34f2a7f07..e8cb0eb178ae56fbfe7951d907300338a85bbc6f 100644 (file)
@@ -64,7 +64,11 @@ USA.
 
 (define (classify-form form senv hist)
   (cond ((identifier? form)
-        (lookup-identifier form senv))
+        (let ((item (lookup-identifier form senv)))
+          (if (reserved-name-item? item)
+              (serror form senv hist
+                      "Premature reference to reserved name:" form))
+          item))
        ((syntactic-closure? form)
         (reclassify (syntactic-closure-form form)
                     (make-partial-senv (syntactic-closure-free form)
@@ -72,7 +76,7 @@ USA.
                                        (syntactic-closure-senv form))
                     hist))
        ((pair? form)
-        (let ((item (classify-form-car form senv hist)))
+        (let ((item (classify-form (car form) senv (hist-car hist))))
           (if (keyword-item? item)
               ((keyword-item-impl item) form senv hist)
               (begin
@@ -80,27 +84,12 @@ USA.
                      (serror form senv hist
                              "Combination must be a proper list:" form))
                  (combination-item item
-                                   (classify-forms-cdr form senv hist))))))
+                                   (classify-forms (cdr form)
+                                                   senv
+                                                   (hist-cdr hist)))))))
        (else
         (constant-item form))))
 
-(define (classify-subform selector form senv hist)
-  (classify-form (subform-select selector form)
-                senv
-                (hist-select selector hist)))
-
-(define (classify-form-car form senv hist)
-  (classify-subform biselector:car form senv hist))
-
-(define (classify-form-cadr form senv hist)
-  (classify-subform biselector:cadr form senv hist))
-
-(define (classify-form-caddr form senv hist)
-  (classify-subform biselector:caddr form senv hist))
-
-(define (classify-form-cadddr form senv hist)
-  (classify-subform biselector:cadddr form senv hist))
-
 (define (reclassify form env hist)
   (classify-form form env (hist-reduce form hist)))
 
@@ -109,21 +98,6 @@ USA.
          (classify-form expr senv hist))
        forms
        hist))
-
-(define (classify-forms-cdr form senv hist)
-  (classify-forms (cdr form) senv (hist-cdr hist)))
-
-(define (classify-forms-in-order forms senv hist)
-  (smap-in-order (lambda (form hist)
-                  (classify-form form senv hist))
-                forms
-                hist))
-
-(define (classify-forms-in-order-cdr form senv hist)
-  (classify-forms-in-order (cdr form) senv (hist-cdr hist)))
-
-(define (classify-forms-in-order-cddr form senv hist)
-  (classify-forms-in-order (cddr form) senv (hist-cddr hist)))
 \f
 ;;;; Syntactic closures
 
@@ -245,15 +219,6 @@ USA.
 (define (hist-cddr hist)
   (hist-select biselector:cddr hist))
 
-(define (hist-caddr hist)
-  (hist-select biselector:caddr hist))
-
-(define (hist-cdddr hist)
-  (hist-select biselector:cdddr hist))
-
-(define (hist-cadddr hist)
-  (hist-select biselector:cadddr hist))
-
 (define (subform-hists forms hist)
   (let loop ((forms forms) (hist hist))
     (if (pair? forms)