Use keyword syntactic environment to implement keywords.
authorChris Hanson <org/chris-hanson/cph>
Fri, 26 Jan 2018 04:07:40 +0000 (20:07 -0800)
committerChris Hanson <org/chris-hanson/cph>
Fri, 26 Jan 2018 04:07:40 +0000 (20:07 -0800)
src/runtime/runtime.pkg
src/runtime/syntax-environment.scm
src/runtime/syntax.scm

index a9341e35a776d1cad8ecd8ddefff124ae4bab6d1..747769c2ba4f1eb871f5d6dbd46e0f296f340250 100644 (file)
@@ -4465,6 +4465,7 @@ USA.
          ->syntactic-environment
          bind-variable!
          make-internal-syntactic-environment
+         make-keyword-syntactic-environment
          make-partial-syntactic-environment
          make-top-level-syntactic-environment
          null-syntactic-environment
index a56ec2b0deda9421807aae392c52e77d7d65c98a..fff0b8075797737b2088aaa7d41ac70d2c625491 100644 (file)
@@ -96,7 +96,7 @@ USA.
 
 ;;; Keyword environments are used to make keywords that represent items.
 
-(define (make-keyword-environment name item)
+(define (make-keyword-syntactic-environment name item)
 
   (define (get-type)
     'keyword)
index fc66c18835a585b793e454d1dcf9074cbf7cf700..1d85a91f7568a0d67fa715a044a7b6399fe587b3 100644 (file)
@@ -169,10 +169,7 @@ USA.
   (item->keyword (make-compiler-item compiler)))
 
 (define (item->keyword item)
-  (let ((environment
-        (make-internal-syntactic-environment null-syntactic-environment)))
-    (syntactic-environment/define environment 'KEYWORD item)
-    (close-syntax 'KEYWORD environment)))
+  (close-syntax 'keyword (make-keyword-syntactic-environment 'keyword item)))
 
 (define (capture-syntactic-environment expander)
   `(,(classifier->keyword