From: Chris Hanson Date: Fri, 22 Feb 2002 01:35:12 +0000 (+0000) Subject: If a synthetic identifier is bound at top level, rename it to a X-Git-Tag: 20090517-FFI~2226 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=0adad767237ac781910dc5df4f3b5b6c1d96e22f;p=mit-scheme.git If a synthetic identifier is bound at top level, rename it to a special name so that it doesn't conflict with other non-EQ? identifiers. --- diff --git a/v7/src/runtime/syntactic-closures.scm b/v7/src/runtime/syntactic-closures.scm index 2933550eb..c9c77cb26 100644 --- a/v7/src/runtime/syntactic-closures.scm +++ b/v7/src/runtime/syntactic-closures.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: syntactic-closures.scm,v 14.6 2002/02/19 21:28:20 cph Exp $ +;;; $Id: syntactic-closures.scm,v 14.7 2002/02/22 01:35:12 cph Exp $ ;;; ;;; Copyright (c) 1989-1991, 2001, 2002 Massachusetts Institute of Technology ;;; @@ -500,7 +500,7 @@ (define (environment/rename environment name) environment - (identifier->symbol name)) + (rename-top-level-identifier name)) ;;; Top-level syntactic environments represent top-level environments. ;;; They are always layered over a real syntactic environment. @@ -553,7 +553,7 @@ (define (top-level-syntactic-environment/rename environment name) environment - (identifier->symbol name)) + (rename-top-level-identifier name)) (define (top-level-syntactic-environment->environment environment) (syntactic-environment->environment @@ -1189,6 +1189,16 @@ (lambda (identifier) (rename-identifier identifier state)))) +(define (rename-top-level-identifier identifier) + (if (symbol? identifier) + identifier + (intern + (string-append "." + (symbol->string (identifier->symbol identifier)) + "." + (number->string (hash identifier)) + "-0")))) + (define (reverse-syntactic-environments environment procedure) (capture-syntactic-environment (lambda (closing-environment)