jeapostrophe / remix

remix - a revised version of Racket
Other
33 stars 3 forks source link

Make macros less weird by… (see inside) #17

Open SuzanneSoy opened 7 years ago

SuzanneSoy commented 7 years ago

Make macros less weird and more like programs, by...

SuzanneSoy commented 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:

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).