2 ms·
I wonder if this might be made even more powerful by using a zippers instead of a single left-right pair; then, the generalized-macro could traverse the entire
by remexre 4y ago
I wonder if this might be made even more powerful by using a zippers instead of a single left-right pair; then, the generalized-macro could traverse the entire top-level form?
- ianthehenry 4y agoI think that a zipper would provide a much nicer interface for making "distant" transformations, but just to be clear you can traverse the entire AST with this approach by recursively returning macros that return macros and then re-assembling the entire tree once you get where you're going. Just, ah, not the easiest code to write :)