4 ms·
> Upon encountering a macro during translation to bytecode, the code generator will look up the macro processor registered for the macro, and pass the AST, root
by asplake 6y ago
> Upon encountering a macro during translation to bytecode, the code generator will look up the macro processor registered for the macro, and pass the AST, rooted at the macro to the processor function. The returned AST will then be substituted for the original tree.
This seems limiting. Just the AST at that point? No more context (potentially alterable) than that?
EDIT: I have a use case in mind, a Haskell-style (kinda) where clause. For such “trailing” syntax it would be necessary to introduce a placeholder higher up the tree