From: Chris Hanson Date: Sat, 3 Mar 2018 18:58:32 +0000 (-0800) Subject: Eliminate a bunch of now-unused classifier procedures. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~222 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3349a721db55f35d461357bb3c3d6ee4e8458340;p=mit-scheme.git Eliminate a bunch of now-unused classifier procedures. --- diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index cdb9a4701..3c8734bb6 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -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 diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index c09b6131d..f8b2d5c40 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -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 diff --git a/src/runtime/syntax.scm b/src/runtime/syntax.scm index d0be31fdf..e8cb0eb17 100644 --- a/src/runtime/syntax.scm +++ b/src/runtime/syntax.scm @@ -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))) ;;;; 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)