From: Taylor R Campbell Date: Thu, 24 Sep 2009 16:33:54 +0000 (-0400) Subject: Fix hygiene in top-level bindings of synthetic identifiers. X-Git-Tag: 20100708-Gtk~317 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=05083d4a6273725564b7f647a6b8d88e0fec2646;p=mit-scheme.git Fix hygiene in top-level bindings of synthetic identifiers. Make such bindings globally unique by creating them with uninterned symbols, bypassing the alpha renaming which was making them look prettier at the expense of global uniqueness. --- diff --git a/src/runtime/syntax-output.scm b/src/runtime/syntax-output.scm index 7ecbc3347..c3ba60013 100644 --- a/src/runtime/syntax-output.scm +++ b/src/runtime/syntax-output.scm @@ -424,7 +424,19 @@ USA. (define (rename-top-level-identifier identifier) (if (symbol? identifier) identifier - (rename-identifier identifier (delay 0)))) + ;; Generate an uninterned symbol here and now, rather than + ;; storing anything in the rename database, because we are + ;; creating a top-level binding for a synthetic name, which must + ;; be globally unique. Using the rename database causes the + ;; substitution logic above to try to use an interned symbol + ;; with a nicer name. The decorations on this name are just + ;; that -- decorations, for human legibility. It is the use of + ;; an uninterned symbol that guarantees uniqueness. + (utf8-string->uninterned-symbol + (string-append "." + (symbol-name (identifier->symbol identifier)) + "." + (number->string (force (make-rename-id))))))) (define (make-name-generator) (let ((id (make-rename-id)))