Rename accessors for syntactic closures.
authorChris Hanson <org/chris-hanson/cph>
Fri, 26 Jan 2018 03:57:18 +0000 (19:57 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 26 Jan 2018 03:57:18 +0000 (19:57 -0800)
src/runtime/defstr.scm
src/runtime/runtime.pkg
src/runtime/syntax-classify.scm
src/runtime/syntax.scm

index 64bea8082dcae670b111247a9d09f2d94afa970f..7976e305bae9110e1b330669975d1c7108e3eacb 100644 (file)
@@ -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)
index 14d42a5b527380be938e7a07903ddfab4c2ae285..2f5c91754927ae54010370ece6cfb1bc33bef2e4 100644 (file)
@@ -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*
index 1ad20bd2eee021b30667cd083fa56bc72e016203..2705307b48d66739ad6dfc1b52d91e40f6e0bd37 100644 (file)
@@ -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
index 64620fbd013322d52d4e4ff61ab1bcb9d9104dfd..fc66c18835a585b793e454d1dcf9074cbf7cf700 100644 (file)
@@ -68,13 +68,11 @@ USA.
 ;;;; Syntactic closures
 
 (define-record-type <syntactic-closure>
-    (%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)))))
 \f