Move definition of access entirely into mit-syntax.
authorChris Hanson <org/chris-hanson/cph>
Fri, 30 Mar 2018 05:58:50 +0000 (22:58 -0700)
committerChris Hanson <org/chris-hanson/cph>
Fri, 30 Mar 2018 05:58:50 +0000 (22:58 -0700)
src/runtime/mit-macros.scm
src/runtime/mit-syntax.scm
src/runtime/runtime.pkg

index 0e2d7211130bb4d7c0df9476b9ec8d676e16f75b..2393cd4160638edca76c2d36d0430ff97d55a57b 100644 (file)
@@ -680,18 +680,6 @@ USA.
                                       exprs)))
             self)))))))
 
-(define $access
-  (spar-transformer->runtime
-   (delay
-     (scons-rule
-        `((+ symbol)
-          any)
-       (lambda (names expr)
-        (fold-right (lambda (name expr)
-                      (scons-call keyword:access name expr))
-                    expr
-                    names))))))
-
 (define-syntax $local-declare
   (syntax-rules ()
     ((local-declare ((directive datum ...) ...) form0 form1+ ...)
index cf05726c8f99bf561293c3c1e0b2436de1b1e2a8..c4bbf827c6de190a04f68606900456162fb380d4 100644 (file)
@@ -318,6 +318,22 @@ USA.
 \f
 ;;;; MIT-specific syntax
 
+(define $access
+  (spar-classifier->runtime
+   (delay
+     (spar-call-with-values
+        (lambda (ctx names env)
+          (fold-right (lambda (name env*)
+                        (access-item ctx name env*))
+                      env
+                      names))
+       (spar-subform)
+       (spar-push spar-arg:ctx)
+       (spar-call-with-values list
+        (spar+ (spar-push-subform-if symbol? spar-arg:form)))
+       (spar-subform spar-push-classified)
+       (spar-match-null)))))
+
 (define-record-type <access-item>
     (access-item ctx name env)
     access-item?
@@ -325,16 +341,6 @@ USA.
   (name access-item-name)
   (env access-item-env))
 
-(define keyword:access
-  (spar-classifier->keyword
-   (delay
-     (spar-call-with-values access-item
-       (spar-subform)
-       (spar-push spar-arg:ctx)
-       (spar-push-subform-if identifier? spar-arg:form)
-       (spar-subform spar-push-classified)
-       (spar-match-null)))))
-
 (define-expr-item-compiler access-item?
   (lambda (item)
     (output/access-reference (access-item-name item)
index 8332781f19a6b44513e12040d9a7ecbe1fc9a649..ee753e9aafa8fa968707b3534ef14e084f5f772a 100644 (file)
@@ -4663,6 +4663,7 @@ USA.
   (files "mit-syntax")
   (parent (runtime syntax))
   (export ()
+         (access $access)
          (begin $begin)
          (declare $declare)
          (define-syntax $define-syntax)
@@ -4682,7 +4683,6 @@ USA.
          (spar-macro-transformer $spar-macro-transformer)
          (the-environment $the-environment))
   (export (runtime mit-macros)
-         keyword:access
          keyword:define
          keyword:let-syntax
          keyword:unassigned
@@ -4692,7 +4692,6 @@ USA.
   (files "mit-macros")
   (parent (runtime))
   (export ()
-         (access $access)
          (and $and)
          (and-let* $and-let*)
          (assert $assert)