Some utilities which help debugging scope-related issues with Racket unhygienic macros (hygienic macros in Racket will likely not need these utilities).
raco pkg install debug-scopes
Then, require one or several of the following modules:
(+scopes stx)returns a string with a succinct representation of which scopes are present on each identifier.
(print-full-scopes)prints the long version of the scope information for the scopes used in preceeding calls to
- (make-named-scope string-or-symbol) creates a scope similarly to
make-syntax-introducer, but annotates it with a name. This is a hack which creates a module with that name, and extracts the module scope (since these scopes have names attached to them in Racket). As a result, with the current implementation, this returns a module scope instead of a macro scope like
syntax-local-introduce. The overridden
syntax-local-introduceworks with the overridden
define-syntaxto flip a named scope instead of the usual macro scope. The use-site scope which may be flipped by
syntax-local-introduceis left unchanged.