From 014a2d5a0d84d7f59fee97d7788d193dfa701f3c Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 25 Jan 2018 19:57:18 -0800 Subject: [PATCH] Rename accessors for syntactic closures. --- src/runtime/defstr.scm | 2 +- src/runtime/runtime.pkg | 6 +++--- src/runtime/syntax-classify.scm | 6 +++--- src/runtime/syntax.scm | 27 +++++++++++---------------- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/runtime/defstr.scm b/src/runtime/defstr.scm index 64bea8082..7976e305b 100644 --- a/src/runtime/defstr.scm +++ b/src/runtime/defstr.scm @@ -252,7 +252,7 @@ differences: (or (let loop ((object object)) (or (not object) (and (syntactic-closure? object) - (loop (syntactic-closure/form object))))) + (loop (syntactic-closure-form object))))) (and (identifier? object) (any (lambda (name) (identifier=? (parser-context/use-environment context) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 14d42a5b5..2f5c91754 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -4395,9 +4395,9 @@ USA. make-synthetic-identifier reverse-syntactic-environments strip-syntactic-closures - syntactic-closure/environment - syntactic-closure/form - syntactic-closure/free-names + syntactic-closure-form + syntactic-closure-free + syntactic-closure-senv syntactic-closure? syntax syntax* diff --git a/src/runtime/syntax-classify.scm b/src/runtime/syntax-classify.scm index 1ad20bd2e..2705307b4 100644 --- a/src/runtime/syntax-classify.scm +++ b/src/runtime/syntax-classify.scm @@ -43,9 +43,9 @@ USA. (output/the-environment))))))) item))) ((syntactic-closure? form) - (let ((form (syntactic-closure/form form)) - (free-names (syntactic-closure/free-names form)) - (closing-env (syntactic-closure/environment form))) + (let ((form (syntactic-closure-form form)) + (free-names (syntactic-closure-free form)) + (closing-env (syntactic-closure-senv form))) (classify/form form (make-partial-syntactic-environment free-names environment diff --git a/src/runtime/syntax.scm b/src/runtime/syntax.scm index 64620fbd0..fc66c1883 100644 --- a/src/runtime/syntax.scm +++ b/src/runtime/syntax.scm @@ -68,13 +68,11 @@ USA. ;;;; Syntactic closures (define-record-type - (%make-syntactic-closure environment free-names form) + (%make-syntactic-closure senv free form) syntactic-closure? - (environment syntactic-closure/environment) - (free-names syntactic-closure/free-names) - (form syntactic-closure/form)) - -(define-guarantee syntactic-closure "syntactic closure") + (senv syntactic-closure-senv) + (free syntactic-closure-free) + (form syntactic-closure-form)) (define (make-syntactic-closure environment free-names form) (let ((senv (->syntactic-environment environment 'MAKE-SYNTACTIC-CLOSURE))) @@ -82,8 +80,8 @@ USA. "list of identifiers" 'MAKE-SYNTACTIC-CLOSURE) (if (or (memq form free-names) ;LOOKUP-IDENTIFIER assumes this. (and (syntactic-closure? form) - (null? (syntactic-closure/free-names form)) - (not (identifier? (syntactic-closure/form form)))) + (null? (syntactic-closure-free form)) + (not (identifier? (syntactic-closure-form form)))) (not (or (syntactic-closure? form) (pair? form) (symbol? form)))) @@ -101,7 +99,7 @@ USA. (cons (loop (car object)) (loop (cdr object))) (if (syntactic-closure? object) - (loop (syntactic-closure/form object)) + (loop (syntactic-closure-form object)) object))) object)) @@ -118,10 +116,7 @@ USA. (define (synthetic-identifier? object) (and (syntactic-closure? object) - (identifier? (syntactic-closure/form object)))) - -(define-guarantee identifier "identifier") -(define-guarantee synthetic-identifier "synthetic identifier") + (identifier? (syntactic-closure-form object)))) (define (make-synthetic-identifier identifier) (close-syntax identifier null-syntactic-environment)) @@ -129,7 +124,7 @@ USA. (define (identifier->symbol identifier) (or (let loop ((identifier identifier)) (if (syntactic-closure? identifier) - (loop (syntactic-closure/form identifier)) + (loop (syntactic-closure-form identifier)) (and (symbol? identifier) identifier))) (error:not-a identifier? identifier 'IDENTIFIER->SYMBOL))) @@ -157,8 +152,8 @@ USA. ((symbol? identifier) (make-variable-item identifier)) ((syntactic-closure? identifier) - (lookup-identifier (syntactic-closure/form identifier) - (syntactic-closure/environment identifier))) + (lookup-identifier (syntactic-closure-form identifier) + (syntactic-closure-senv identifier))) (else (error:not-a identifier? identifier 'LOOKUP-IDENTIFIER))))) -- 2.25.1