From 9335e3cf285f6f25a100005fb69be0019646db29 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 17 Mar 2009 21:06:42 +0000 Subject: [PATCH] doc updates for v4.1.5.2 svn: r14161 --- collects/scribble/text/syntax-utils.ss | 6 +++-- collects/scribblings/reference/stx-comp.scrbl | 23 ++++++++++++------- .../scribblings/reference/stx-trans.scrbl | 10 ++++---- .../scribblings/reference/syntax-model.scrbl | 9 ++++++-- collects/tests/mzscheme/macro.ss | 1 + doc/release-notes/mzscheme/HISTORY.txt | 4 ++++ 6 files changed, 37 insertions(+), 16 deletions(-) diff --git a/collects/scribble/text/syntax-utils.ss b/collects/scribble/text/syntax-utils.ss index 2c181e4efa..5ec450eb5c 100644 --- a/collects/scribble/text/syntax-utils.ss +++ b/collects/scribble/text/syntax-utils.ss @@ -159,8 +159,10 @@ (cond [(pair? rest) #`(list* #,@nondefns (begin/collect* #t #,@rest))] [(and (not always-list?) (= 1 (length nondefns))) (car nondefns)] [else #`(list #,@nondefns)])) - (local-expand (if (null? defns) body #`(let () #,@defns #,body)) - context stoplist (car context))) + (begin0 + (local-expand (if (null? defns) body #`(let () #,@defns #,body)) + context stoplist (car context)) + (internal-definition-context-seal (car context)))) (define-syntax-rule (begin/collect x ...) (begin/collect* #f x ...)) ;; begin for templates (allowing definition blocks) diff --git a/collects/scribblings/reference/stx-comp.scrbl b/collects/scribblings/reference/stx-comp.scrbl index bdcacc0ba9..8bcda845b5 100644 --- a/collects/scribblings/reference/stx-comp.scrbl +++ b/collects/scribblings/reference/stx-comp.scrbl @@ -22,15 +22,16 @@ suitable expression context at the @tech{phase level} indicated by Returns @scheme[#t] if @scheme[a-id] and @scheme[b-id] access the same @tech{local binding}, @tech{module binding}, or @tech{top-level -binding} at the @tech{phase level} indicated by -@scheme[phase-level]. A @scheme[#f] value for @scheme[phase-level] -corresponds to the @tech{label phase level}. +binding}---perhaps via @tech{rename transformers}---at the @tech{phase +level} indicated by @scheme[phase-level]. A @scheme[#f] value for +@scheme[phase-level] corresponds to the @tech{label phase level}. ``Same module binding'' means that the identifiers refer to the same -original definition site, not necessarily the @scheme[require] or -@scheme[provide] site. Due to renaming in @scheme[require] and -@scheme[provide], the identifiers may return distinct results with -@scheme[syntax-e].} +original definition site, and not necessarily to the same +@scheme[require] or @scheme[provide] site. Due to renaming in +@scheme[require] and @scheme[provide], or due to a transformer binding +to a @tech{rename transformer}, the identifiers may return distinct +results with @scheme[syntax-e].} @defproc[(free-transformer-identifier=? [a-id syntax?][b-id syntax?]) boolean?]{ @@ -132,7 +133,13 @@ Returns one of three kinds of values, depending on the binding of @tech{top-level binding} (or, equivalently, if it is @tech{unbound}).} - }} + } + +If @scheme[id-stx] is bound to a @tech{rename-transformer}, the result +from @scheme[identifier] binding is for the identifier in the +transformer, so that @scheme[identifier-binding] is consistent with +@scheme[free-identifier=?].} + @defproc[(identifier-transformer-binding [id-stx syntax?]) (or/c 'lexical diff --git a/collects/scribblings/reference/stx-trans.scrbl b/collects/scribblings/reference/stx-trans.scrbl index fac8180a96..49e188aa33 100644 --- a/collects/scribblings/reference/stx-trans.scrbl +++ b/collects/scribblings/reference/stx-trans.scrbl @@ -66,10 +66,12 @@ Returns the procedure that was passed to Creates a @tech{rename transformer} that, when used as a @tech{transformer binding}, acts as a transformer that insert the identifier @scheme[id-stx] in place of whatever identifier binds the -transformer, including in non-application positions, and in -@scheme[set!] expressions. Such a transformer could be written -manually, but the one created by @scheme[make-rename-transformer] -cooperates specially with @scheme[syntax-local-value] and +transformer, including in non-application positions, in @scheme[set!] +expressions. Such a transformer could be written manually, but the one +created by @scheme[make-rename-transformer] also causes the parser to +install a @scheme[free-identifier=?] and @scheme[identifier-binding] +equivalence, and it cooperates specially with +@scheme[syntax-local-value] and @scheme[syntax-local-make-delta-introducer].} diff --git a/collects/scribblings/reference/syntax-model.scrbl b/collects/scribblings/reference/syntax-model.scrbl index dfa0d2bf55..aa201a3ae1 100644 --- a/collects/scribblings/reference/syntax-model.scrbl +++ b/collects/scribblings/reference/syntax-model.scrbl @@ -542,8 +542,13 @@ also handled specially by the expander and by @scheme[set!] as a transformer binding's value. When @scheme[_id] is bound to a @deftech{rename transformer} produced by @scheme[make-rename-transformer], it is replaced with the identifier -passed to @scheme[make-rename-transformer]. Furthermore, the binding -is also specially handled by @scheme[syntax-local-value] and +passed to @scheme[make-rename-transformer]. In addition, the lexical +information that contains the binding of @scheme[_id] is also enriched +so that @scheme[_id] is @scheme[free-identifier=?] to the identifier +passed to @scheme[make-rename-transformer], and +@scheme[identifier-binding] returns the same results for both +identifiers. Finally, the binding is treated specially by +@scheme[syntax-local-value], and @scheme[syntax-local-make-delta-introducer] as used by @tech{syntax transformer}s. diff --git a/collects/tests/mzscheme/macro.ss b/collects/tests/mzscheme/macro.ss index 5c9b022a05..9087be2801 100644 --- a/collects/tests/mzscheme/macro.ss +++ b/collects/tests/mzscheme/macro.ss @@ -415,6 +415,7 @@ [(define-values (id) rhs) (begin (syntax-local-bind-syntaxes (list #'id) #f def-ctx) + (internal-definition-context-seal def-ctx) #'(begin (define-values (id) rhs) (define-syntax handle (quote-syntax id))))] diff --git a/doc/release-notes/mzscheme/HISTORY.txt b/doc/release-notes/mzscheme/HISTORY.txt index eacec19c81..52c6065aa0 100644 --- a/doc/release-notes/mzscheme/HISTORY.txt +++ b/doc/release-notes/mzscheme/HISTORY.txt @@ -1,3 +1,7 @@ +Version 4.1.5.2 +Changed expander to detect a reaname transformer and install a + free-identifier=? syntax-object equivalence + Version 4.1.5, March 2009 Allow infix notation for prefab structure literals Change quasiquote so that unquote works in value positions of #hash