Helper utilities to debug scope-related problems in Racket
Go to file
2021-05-11 01:25:25 +01:00
named-scopes Provide an make-module-like-named-scope alias for make-named-scope, which will always produce a module-like named scope, even if later versions of Racket enable macro-like named scopes. 2017-01-20 13:37:21 +01:00
scribblings Changed my name :) 2021-03-04 20:37:31 +00:00
test Cleanup 2016-12-14 18:11:25 +01:00
.gitignore Initial commit 2016-12-14 17:44:42 +01:00
.travis.yml Turn off coverage in older versions 2021-03-05 04:00:31 +00:00
info.rkt Changed my name :) 2021-03-04 20:43:47 +00:00
LICENSE-more.md Changed my name :) 2021-03-04 20:37:31 +00:00
LICENSE.txt Switched to Public Domain / CC0 license now that I got permission from Cortus to release the packages in the Public Domain. This ensures that the code can be merged into other Racket projects, regardless of future license changes for the Racket project. 2017-01-19 20:02:26 +01:00
main.rkt Also provide make-named-scope directly from (require debug-scopes) 2016-12-15 00:28:29 +01:00
named-scopes-sli-parameter.rkt Various changes & bugfixes, more documentation. 2016-12-14 19:49:44 +01:00
named-scopes.rkt Initial commit 2016-12-14 17:44:42 +01:00
README.md Updated "maintained" badge 2021-05-11 01:25:25 +01:00
superscripts.rkt use pretty-printing in +scopes 2018-05-24 17:08:28 -04:00

Build Status, Coverage Status, Build Stats, Online Documentation, Maintained as of 2021, License: CC0 v1.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.
(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.
(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.