From 564b17635a9b3166e95b0aa3e053e50b9c6385d2 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Thu, 25 Jan 2018 20:07:40 -0800 Subject: [PATCH] Use keyword syntactic environment to implement keywords. --- src/runtime/runtime.pkg | 1 + src/runtime/syntax-environment.scm | 2 +- src/runtime/syntax.scm | 5 +---- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index a9341e35a..747769c2b 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -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 diff --git a/src/runtime/syntax-environment.scm b/src/runtime/syntax-environment.scm index a56ec2b0d..fff0b8075 100644 --- a/src/runtime/syntax-environment.scm +++ b/src/runtime/syntax-environment.scm @@ -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) diff --git a/src/runtime/syntax.scm b/src/runtime/syntax.scm index fc66c1883..1d85a91f7 100644 --- a/src/runtime/syntax.scm +++ b/src/runtime/syntax.scm @@ -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 -- 2.25.1