From 6b6e3aefe7680fb5a87f1b08353afd82cf1ed4af Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 31 Jan 2018 23:00:26 -0800 Subject: [PATCH] Don't use syntactic enviroment to indirectly bind global macros. --- src/runtime/syntax-definitions.scm | 62 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/src/runtime/syntax-definitions.scm b/src/runtime/syntax-definitions.scm index 8631e26e4..5a3120afd 100644 --- a/src/runtime/syntax-definitions.scm +++ b/src/runtime/syntax-definitions.scm @@ -29,35 +29,33 @@ USA. (declare (usual-integrations)) -(define (initialize-package!) - (create-bindings (->syntactic-environment system-global-environment))) - -(define (create-bindings senv) - - (define (def name item) - (bind-keyword senv name item)) - - (define (define-classifier name classifier) - (def name (classifier-item classifier))) - - (define-classifier 'BEGIN classifier:begin) - (define-classifier 'DECLARE classifier:declare) - (define-classifier 'DEFINE-SYNTAX classifier:define-syntax) - (define-classifier 'ER-MACRO-TRANSFORMER classifier:er-macro-transformer) - (define-classifier 'LET-SYNTAX classifier:let-syntax) - (define-classifier 'LETREC-SYNTAX classifier:letrec-syntax) - (define-classifier 'RSC-MACRO-TRANSFORMER classifier:rsc-macro-transformer) - (define-classifier 'SC-MACRO-TRANSFORMER classifier:sc-macro-transformer) - - (define (define-compiler name compiler) - (def name (compiler-item compiler))) - - (define-compiler 'DELAY compiler:delay) - (define-compiler 'IF compiler:if) - (define-compiler 'LAMBDA compiler:lambda) - (define-compiler 'NAMED-LAMBDA compiler:named-lambda) - (define-compiler 'OR compiler:or) - (define-compiler 'QUOTE compiler:quote) - (define-compiler 'quote-identifier compiler:quote-identifier) - (define-compiler 'SET! compiler:set!) - (define-compiler 'THE-ENVIRONMENT compiler:the-environment)) \ No newline at end of file +(add-boot-init! + (lambda () + + (define (def name item) + (environment-define-macro system-global-environment name item)) + + (define (define-classifier name classifier) + (def name (classifier-item classifier))) + + (define-classifier 'BEGIN classifier:begin) + (define-classifier 'DECLARE classifier:declare) + (define-classifier 'DEFINE-SYNTAX classifier:define-syntax) + (define-classifier 'ER-MACRO-TRANSFORMER classifier:er-macro-transformer) + (define-classifier 'LET-SYNTAX classifier:let-syntax) + (define-classifier 'LETREC-SYNTAX classifier:letrec-syntax) + (define-classifier 'RSC-MACRO-TRANSFORMER classifier:rsc-macro-transformer) + (define-classifier 'SC-MACRO-TRANSFORMER classifier:sc-macro-transformer) + + (define (define-compiler name compiler) + (def name (compiler-item compiler))) + + (define-compiler 'DELAY compiler:delay) + (define-compiler 'IF compiler:if) + (define-compiler 'LAMBDA compiler:lambda) + (define-compiler 'NAMED-LAMBDA compiler:named-lambda) + (define-compiler 'OR compiler:or) + (define-compiler 'QUOTE compiler:quote) + (define-compiler 'quote-identifier compiler:quote-identifier) + (define-compiler 'SET! compiler:set!) + (define-compiler 'THE-ENVIRONMENT compiler:the-environment))) \ No newline at end of file -- 2.25.1