https://github.com/suzannesoy/debug-scopes
Helper utilities to debug scope-related problems in Racket
https://github.com/suzannesoy/debug-scopes
racket-library
Last synced: 4 months ago
JSON representation
Helper utilities to debug scope-related problems in Racket
- Host: GitHub
- URL: https://github.com/suzannesoy/debug-scopes
- Owner: SuzanneSoy
- License: cc0-1.0
- Created: 2016-12-14T18:50:14.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2021-05-11T00:47:21.000Z (about 5 years ago)
- Last Synced: 2025-01-30T11:42:19.082Z (over 1 year ago)
- Topics: racket-library
- Language: Racket
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-more.md
Awesome Lists containing this project
README
[](https://travis-ci.org/jsmaniac/debug-scopes)
[](https://codecov.io/gh/jsmaniac/debug-scopes)
[](http://jsmaniac.github.io/travis-stats/#jsmaniac/debug-scopes)
[](http://docs.racket-lang.org/debug-scopes/)
[](https://github.com/jsmaniac/debug-scopes/issues)
[](https://creativecommons.org/publicdomain/zero/1.0/)
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`.
```racket
(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 like
`make-syntax-introducer`.
```racket
(require debug-scopes/named-scopes/override)
```
* Overrides `define-syntax` and `syntax-local-introduce`. The overridden
`syntax-local-introduce` works with the overridden `define-syntax` to flip a
named scope instead of the usual macro scope. The use-site scope which may
be flipped by `syntax-local-introduce` is left unchanged.