From 317d74a2752ac60228b663c4b9dc17151df85c2b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 11 Feb 2018 21:37:09 -0800 Subject: [PATCH] Eliminate compiler items. --- src/edwin/clsmac.scm | 38 ++++++++++++++++++++---------------- src/edwin/edwin.pkg | 3 ++- src/runtime/host-adapter.scm | 7 ++++--- src/runtime/runtime.pkg | 3 --- src/runtime/syntax-items.scm | 7 ------- src/runtime/syntax.scm | 5 ----- 6 files changed, 27 insertions(+), 36 deletions(-) diff --git a/src/edwin/clsmac.scm b/src/edwin/clsmac.scm index eeb479e66..c8dd91ef0 100644 --- a/src/edwin/clsmac.scm +++ b/src/edwin/clsmac.scm @@ -86,26 +86,30 @@ USA. (define with-instance-variables (make-unmapped-macro-reference-trap - (compiler-item - (lambda (form environment . rest) + (classifier-item + ;; Rest arg facilitates cross-compiling from 9.2. + ;; It should be removed after 9.3 release. + (lambda (form senv . rest) (syntax-check '(_ identifier expression (* identifier) + expression) form) (let ((class-name (cadr form)) - (self (caddr form)) + (self-item (apply classify-form (caddr form) senv rest)) (free-names (cadddr form)) - (body (cddddr form))) - (transform-instance-variables - (class-instance-transforms - (name->class (identifier->symbol class-name))) - (compile-expr-item (apply classify-form self environment rest)) - free-names - (compile-expr-item - (apply classify-form - `(,(close-syntax 'begin - (runtime-environment->syntactic - system-global-environment)) - ,@body) - environment - rest)))))))) + (body-item + (apply classify-form + `(,(close-syntax 'begin + (runtime-environment->syntactic + system-global-environment)) + ,@(cddddr form)) + senv + rest))) + (expr-item + (lambda () + (transform-instance-variables + (class-instance-transforms + (name->class (identifier->symbol class-name))) + (compile-expr-item self-item) + free-names + (compile-expr-item body-item))))))))) (define-syntax ==> (syntax-rules () diff --git a/src/edwin/edwin.pkg b/src/edwin/edwin.pkg index 5894b7d21..6dc4d9c7d 100644 --- a/src/edwin/edwin.pkg +++ b/src/edwin/edwin.pkg @@ -285,9 +285,10 @@ USA. usual==> with-instance-variables) (import (runtime syntax) + classifier-item classify-form compile-expr-item - compiler-item)) + expr-item)) (define-package (edwin class-macros transform-instance-variables) (files "xform") diff --git a/src/runtime/host-adapter.scm b/src/runtime/host-adapter.scm index 25a3b007e..95fa1b960 100644 --- a/src/runtime/host-adapter.scm +++ b/src/runtime/host-adapter.scm @@ -189,11 +189,12 @@ USA. env 'microcode-type)))) (let ((env (->environment '(runtime syntax)))) - (provide-rename env 'make-compiler-item 'compiler-item) + (provide-rename env 'make-classifier-item 'classifier-item) + (provide-rename env 'make-expression-item 'expr-item) (provide-rename env 'compile-item/expression 'compile-expr-item) (if (unbound? env 'classify-form) - (eval '(define (classify-form form env) - (classify/form form env env)) + (eval '(define (classify-form form senv #!optional hist) + (classify/form form senv senv)) env))) (let ((env (->environment '(package)))) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index d05fd214b..52620f412 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4449,9 +4449,6 @@ USA. classifier-item classifier-item-impl classifier-item? - compiler-item - compiler-item-impl - compiler-item? combination-item constant-item decl-item diff --git a/src/runtime/syntax-items.scm b/src/runtime/syntax-items.scm index 23cd6170f..698f721d6 100644 --- a/src/runtime/syntax-items.scm +++ b/src/runtime/syntax-items.scm @@ -38,11 +38,6 @@ USA. classifier-item? (impl classifier-item-impl)) -(define-record-type - (compiler-item impl) - compiler-item? - (impl compiler-item-impl)) - (define-record-type (expander-item impl expr) expander-item? @@ -51,12 +46,10 @@ USA. (define (keyword-item? object) (or (classifier-item? object) - (compiler-item? object) (expander-item? object))) (register-predicate! keyword-item? 'keyword-item) (set-predicate<=! classifier-item? keyword-item?) -(set-predicate<=! compiler-item? keyword-item?) (set-predicate<=! expander-item? keyword-item?) ;;; Variable items represent run-time variables. diff --git a/src/runtime/syntax.scm b/src/runtime/syntax.scm index 901c00629..9f2ed2eb2 100644 --- a/src/runtime/syntax.scm +++ b/src/runtime/syntax.scm @@ -98,11 +98,6 @@ USA. (let ((item (classify-form-car form senv hist))) (cond ((classifier-item? item) ((classifier-item-impl item) form senv hist)) - ((compiler-item? item) - (expr-item - (let ((compiler (compiler-item-impl item))) - (lambda () - (compiler form senv hist))))) ((expander-item? item) (reclassify ((expander-item-impl item) form senv) senv -- 2.25.1