resyntax icon indicating copy to clipboard operation
resyntax copied to clipboard

Ask politely for a stable macro expander hook

Open jackfirth opened this issue 5 years ago • 1 comments

At present, resyntax relies on the undocumented and deeply magic current-expand-observe parameter (intended for the macro stepper) to apply refactoring rules to visited syntax objects. This has a few problems:

  • It's an unstable API whose details change whenever the macro expander or macro stepper changes.
  • It provides way more information than resyntax needs. All resyntax needs is a list of original syntax objects visited during expansion.
  • It doesn't provide a way to pause expansion, so there doesn't seem to be a way for refactoring rules to use local-expand or syntax-local-value.

Eventually it would be nice to have a public, documented, stable, and less powerful alternative to current-expand-observe in Racket.

jackfirth avatar Jan 13 '21 21:01 jackfirth

Possible idea: maybe something in the syntax-check code could be used?

jackfirth avatar Jan 15 '21 11:01 jackfirth