Macro parameter
A macro parameter is a named placeholder in a macro definition that receives the corresponding argument from a macro invocation for expansion.
Write Powerful Rust Macros
A macro variable is a named binding in a declarative macro that refers to syntax captured by a matcher.
- How it is used
- Uses named bindings to pass matched Rust syntax from a declarative macro matcher into its transcriber.
- How deep it goes
- Defines dollar-prefixed bindings and fragment specifiers, then compares precise matches with broad `tt` matching.
- Examples
- Demonstrates empty-vector expansion, expression capture, vector insertion, and repeated comma-separated expressions.
- What you can do after
- Build declarative macro arms that capture expressions and expand them into generated Rust code.
Read how Write Powerful Rust Macros explains macro parameter →
Modern C
A macro parameter is a named placeholder in a function-like macro definition that receives replacement tokens from a macro invocation.
- How it is used
- Supports reusable textual transformations in C function-like macros during the preprocessing stage.
- How deep it goes
- Explains naming, argument parsing, recursive expansion, substitution, and stringification, but stops short of broader macro operators.
- Examples
- Uses BYTECOPY substitutions and trace macros that stringify expressions such as sum and sum*argc.
- What you can do after
- Apply it via C preprocessing to predict parameter substitution and preserve or stringify invocation arguments deliberately.
Related concepts
- macroused by · A macro is a named construct that expands or transforms source code, commands, or templates before or during execution.
- stringification operatorused by · The stringification operator is the C preprocessor operator # that converts a macro argument's textual spelling into a string literal.
- inputcontrasts with · An input is a value, information, or signal supplied to a system, computation, or interface for processing or to influence its behavior.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

