- Start Date: (fill me in with today's date, YYYY-MM-DD)
- RFC PR #: (leave this empty)
- Rust Issue #: (leave this empty)
# Summary
generalize the ability to gather invocations (exhibited by #[test]) , easily accessible in a proposed macro ```gather!()``` and attribute ```#[gather_into(<macro_name>)]```
see also forum post https://users.rust-lang.org/t/gather-macro-invocations-e-g-class-factory-roll-one-big-enum/11674
# Motivation
Potentially useful for rolling 'class factories', 'component systems', bindings to scripting languages/UIs; also a similar use case is already demonstrated in the inbuilt unit tests, where ```#[test]``` gathers many functions and calls them from a generated test function. Macros accessible from the language out of the box will see more use than compiler plugins.
Rust offers a choice between 'sorting by type', and 'sorting by function' (e.g. polymorphism through traits, or matching on enum variants). A user could wrap seperate types and functions in a macro that can be rolled either way. (e.g. many structs could be ```gather!```ed into a tuple struct,or many functions could be ```gather!```ed into a single match body.)
Some use cases are already possible with nested repeat features , but they require items to be declared in one location (e.g. a project may prefer to have 'a source file per entity', rather than one source file defining all the entities)
## Possible examples of applicability
###'high order macro'
This file has been truncated. show original