From: Chris Hanson Date: Wed, 14 Feb 2018 01:37:28 +0000 (-0800) Subject: decl-item doesn't need to be distinct from expr-item. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~245 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c2d0d57a969e5aa29881b84bddd6d102918ef2c6;p=mit-scheme.git decl-item doesn't need to be distinct from expr-item. --- diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index 7444436ab..e9f9147cb 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -294,9 +294,7 @@ USA. (classifier->runtime (lambda (form senv hist) (syntax-check '(_ * (identifier * datum)) form) - (decl-item - (lambda () - (classify-decls (cdr form) senv (hist-cdr hist))))))) + (decl-item (lambda () (classify-decls (cdr form) senv (hist-cdr hist))))))) (define (classify-decls decls senv hist) (map (lambda (decl hist) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index dfc58f02f..d2f39a979 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4452,8 +4452,6 @@ USA. compile-expr-item constant-item decl-item - decl-item-text - decl-item? define-item-compiler defn-item defn-item-id diff --git a/src/runtime/syntax-items.scm b/src/runtime/syntax-items.scm index 56a0a8064..c0db7aac3 100644 --- a/src/runtime/syntax-items.scm +++ b/src/runtime/syntax-items.scm @@ -88,8 +88,7 @@ USA. (%defn-item id value #f)) (define (defn-item-value? object) - (not (or (reserved-name-item? object) - (decl-item? object)))) + (not (reserved-name-item? object))) (register-predicate! defn-item-value? 'defn-item-value) (define-record-type @@ -134,17 +133,6 @@ USA. (expr-item compiler) expr-item? (compiler expr-item-compiler)) - -;;; Declaration items represent block-scoped declarations that are to -;;; be passed through to the compiler. - -(define-record-type - (decl-item text-getter) - decl-item? - (text-getter decl-item-text-getter)) - -(define (decl-item-text item) - ((decl-item-text-getter item))) ;;;; Specific expression items @@ -210,6 +198,11 @@ USA. (lambda () (output/disjunction (map compile-expr-item items))))) +(define (decl-item classify) + (expr-item + (lambda () + (output/declaration (classify))))) + (define (the-environment-item) (expr-item output/the-environment)) @@ -247,10 +240,6 @@ USA. (lambda (item) (output/sequence (map compile-expr-item (seq-item-elements item))))) -(define-item-compiler decl-item? - (lambda (item) - (output/declaration (decl-item-text item)))) - (define-item-compiler defn-item? (lambda (item) (if (defn-item? item)