Open SuzanneSoy opened 7 years ago
In my experience, one of the hardest part about macros is getting the scopes right for unhygienic macros (e.g. macros which communicate with each other). Quite often I will end up with a spurious scope on one identifier, and figuring out what operation flipped that scope can be a painful task. Some of the issues I noted are:
snip%
for syntax object when they are printed in DrRacket shows some useful info, but does not show the list of scopes present on that object. Opening the syntax debugger from the snip% would help tremendously when debugging.make-syntax-introducer
, that would help when debugging by indicating which macro introduced the scope and for what purpose)To help with debugging, I wrote a small tool (unpackaged for now) which dumps a syntax object with its scopes in a concise way (I find it more readable than the representation in the macro stepper, when comparing two or more parts of the syntax object, looking for a scope that one has and the other lacks).
Make macros less weird and more like programs, by...