Eliminate compiler items.
authorChris Hanson <org/chris-hanson/cph>
Mon, 12 Feb 2018 05:37:09 +0000 (21:37 -0800)
committerChris Hanson <org/chris-hanson/cph>
Mon, 12 Feb 2018 05:37:09 +0000 (21:37 -0800)
src/edwin/clsmac.scm
src/edwin/edwin.pkg
src/runtime/host-adapter.scm
src/runtime/runtime.pkg
src/runtime/syntax-items.scm
src/runtime/syntax.scm

index eeb479e6667dd10c9ee7d93d91f3e1927b165326..c8dd91ef08d741616e818fe52294c24e8678be1a 100644 (file)
@@ -86,26 +86,30 @@ USA.
 \f
 (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 ()
index 5894b7d2180bfeacef07507e197740168c69d6a9..6dc4d9c7d48c390920c1336144b5a051c68bd2b2 100644 (file)
@@ -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")
index 25a3b007e0dfa650ec9ee79feffb9ecff7ede019..95fa1b9600dae9fd1928f8e728b23ee78e3b8f59 100644 (file)
@@ -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))))
index d05fd214bc36338db42a981e9862779ee66a4d28..52620f412c6f382fd36132834d362ecefed258bf 100644 (file)
@@ -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
index 23cd6170f5519591f23145713dfff0f629cef985..698f721d6e500e362b28e9f628b8bb2278e89411 100644 (file)
@@ -38,11 +38,6 @@ USA.
     classifier-item?
   (impl classifier-item-impl))
 
-(define-record-type <compiler-item>
-    (compiler-item impl)
-    compiler-item?
-  (impl compiler-item-impl))
-
 (define-record-type <expander-item>
     (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.
index 901c006298e16f55f74fc9ae70d2485758a9acc4..9f2ed2eb2c6d396300719f9461cd54fae300b8ba 100644 (file)
@@ -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