From: Taylor R. Campbell Date: Sun, 20 Nov 2005 04:12:59 +0000 (+0000) Subject: In binding items generated by top-level syntax definitions, rename the X-Git-Tag: 20090517-FFI~1179 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=6c7efe9782c004fdb5f88b7780b9c5b4b4963caf;p=mit-scheme.git In binding items generated by top-level syntax definitions, rename the identifier being bound with RENAME-TOP-LEVEL-IDENTIFIER, because some syntax definitions are produced with temporary synthetic identifiers, which the output interface should not see. Also, elide the unnecessary OVERLOADED-BINDING-THEORY indirection in variable and syntactic definition form classification. --- diff --git a/v7/src/runtime/mit-syntax.scm b/v7/src/runtime/mit-syntax.scm index 0f2dd9049..44a24f857 100644 --- a/v7/src/runtime/mit-syntax.scm +++ b/v7/src/runtime/mit-syntax.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: mit-syntax.scm,v 14.22 2004/11/18 18:16:04 cph Exp $ +$Id: mit-syntax.scm,v 14.23 2005/11/20 04:12:59 riastradh Exp $ Copyright 1989,1990,1991,2001,2002,2003 Massachusetts Institute of Technology Copyright 2004 Massachusetts Institute of Technology @@ -262,27 +262,23 @@ USA. (let ((history (item/history item))) (syntax-error history "Syntactic binding value must be a keyword:" (history/original-form history)))) - (overloaded-binding-theory environment name item history)) + (syntactic-environment/define environment + name + (item/new-history item #f)) + ;; User-defined macros at top level are preserved in the output. + (if (and (keyword-value-item? item) + (syntactic-environment/top-level? environment)) + (make-binding-item history + (rename-top-level-identifier name) + item) + (make-null-binding-item history))) (define (variable-binding-theory environment name item history) (if (keyword-item? item) (let ((history (item/history item))) (syntax-error history "Binding value may not be a keyword:" (history/original-form history)))) - (overloaded-binding-theory environment name item history)) - -(define (overloaded-binding-theory environment name item history) - (if (keyword-item? item) - (begin - (syntactic-environment/define environment - name - (item/new-history item #f)) - ;; User-defined macros at top level are preserved in the output. - (if (and (keyword-value-item? item) - (syntactic-environment/top-level? environment)) - (make-binding-item history name item) - (make-null-binding-item history))) - (make-binding-item history (bind-variable! environment name) item))) + (make-binding-item history (bind-variable! environment name) item)) ;;;; SRFI features