From 3bf9ae25e28a4994ee76327d7b48fa88659bf9db Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 14 Aug 2011 08:15:07 -0500 Subject: [PATCH] add a note about the disappeared properties to the check syntax section of the manual --- collects/scribblings/tools/tools.scrbl | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/collects/scribblings/tools/tools.scrbl b/collects/scribblings/tools/tools.scrbl index c1ce0856e2..ef1de65992 100644 --- a/collects/scribblings/tools/tools.scrbl +++ b/collects/scribblings/tools/tools.scrbl @@ -804,6 +804,35 @@ Check Syntax is a part of the DrRacket collection, but is implemented via the to The bitmap in the Check Syntax button on the DrRacket frame. } +@subsection{Disappeared uses and bindings} + +@section-index["disappeared-use" "disappeared-binding"] + +Check Syntax collects the values of the +@racket[syntax-property]s named +@racket['disappeared-use] and +@racket['disappeared-binding] and uses them to add +additional arrows to the program text. These properties are +intended for use when a macro discards identifiers that, +from the programmers perspective, should be binding each other. + +For example, here is a macro that discards its arguments, but +adds properties to the result syntax object so the arguments +are treated as a binding/bound pair by Check Syntax. + +@racketblock[ + (define-syntax (m stx) + (syntax-case stx () + [(_ id1 id2) + (and (identifier? #'id1) (identifier? #'id2)) + (syntax-property + (syntax-property + #'1 + 'disappeared-use (list (syntax-local-introduce #'id1))) + 'disappeared-binding (list (syntax-local-introduce #'id2)))]))] + +See also @racket[current-recorded-disappeared-uses]. + @section{Teaching Languages} The teaching language are implemented via the tools interface and thus