Code Product
This crate provides two things:
- A library to generate code by expanding a product syntax. This is the primary objective of this crate as it enables code generation in a convenient way from other proc macros.
- The standalone
product!{}andproduct_items!{}macros to generate code using the library as it is useful on its own.
Product expansion
The name product is because it expands to the product of all defined sets. For example given
are the two sets of defintions 'Foo and Bar' and 'This and That', showing different syntactic
variants:
# use product;
#
# ; ;
# ; ;
product!
or
# use product;
#
# ; ;
# ; ;
product!
either of the above will expand four times to:
#
# ; ;
# ; ;
Product Syntax
The detailed syntax for product definitions is described at: The product syntax.