pre-RFC, 'gather macro'


any thoughts on this idea, a ‘gather’ feature in the macro system, allowing macros to collect information from elsewhere, or allowing pieces of recursive macros to be collected

any other ideas on how to achieve the goals here? I know the existing macro system is very capable.

1 Like

Help stabilize a subset of Macros 2.0!

Cargo does something similar for subcommands with a high order macro:

You still are required to explicitelly list all the entries in one place, but then you can use arbitrary macros to process them.



reminiscent of the x-macros trick in C, but obviously a lot more sane here.

So basically this is an example of a case where a ‘gather macro’ might help (generating that list). i guess in that case you could probably avoid the need to ‘maintain the list’ by embedding all the original code in the macro, but gathering from multiple source files would be saner for project organization

1 Like

closed #4

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.