From 9371e8753978b8dd8646b81c114144a5ac56927e Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 29 Mar 2018 22:58:50 -0700 Subject: [PATCH] Move definition of access entirely into mit-syntax. --- src/runtime/mit-macros.scm | 12 ------------ src/runtime/mit-syntax.scm | 26 ++++++++++++++++---------- src/runtime/runtime.pkg | 3 +-- 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index 0e2d72111..2393cd416 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -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+ ...) diff --git a/src/runtime/mit-syntax.scm b/src/runtime/mit-syntax.scm index cf05726c8..c4bbf827c 100644 --- a/src/runtime/mit-syntax.scm +++ b/src/runtime/mit-syntax.scm @@ -318,6 +318,22 @@ USA. ;;;; 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 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) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 8332781f1..ee753e9aa 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -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) -- 2.25.1