Blog: Procedural Macros vs. Macros

Wherein we expand, if not our mind, then at least our macros.


That's neat! I wouldn't have though it would be that easy to expand a macro programmatically.

Does that mean you're effectively expanding the macro and emitting the result back instead of the compiler doing it itself later?

Thanks @llogiq, I'm in the design phase on a project in which I will probably have to do this. :slight_smile:

Yes, but I get to manipulate it before emitting.

Edit: Note that it's possible to work on bare token trees, too, but it's not very ergonomic.

1 Like