Helper utilities to debug scope-related problems in Racket
named-scopes | ||
scribblings | ||
test | ||
.gitignore | ||
.travis.yml | ||
info.rkt | ||
LICENSE-more.md | ||
LICENSE.txt | ||
main.rkt | ||
named-scopes-sli-parameter.rkt | ||
named-scopes.rkt | ||
README.md | ||
superscripts.rkt |
debug-scopes
Some utilities which help debugging scope-related issues with Racket unhygienic macros (hygienic macros in Racket will likely not need these utilities).
First, run:
raco pkg install debug-scopes
Then, require one or several of the following modules:
(require debug-scopes)
(+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+scopes
.
(require debug-scopes/named-scopes)
- (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 likemake-syntax-introducer
.
(require debug-scopes/named-scopes/override)
- Overrides
define-syntax
andsyntax-local-introduce
. The overriddensyntax-local-introduce
works with the overriddendefine-syntax
to flip a named scope instead of the usual macro scope. The use-site scope which may be flipped bysyntax-local-introduce
is left unchanged.