Declarative Macros

Declarative macros look like a function: e.g. println!(), format!() or todo!(). They have an exclamation mark between the name and the parameter list.

Declarative macros are like "shortcuts", it is usually more code, packed in a code block, which will generated at the place where it is called. This has the benefit, that it is not a function call, hence does not add to the stack or needs to consider moving. It is like a template, which will be copied in place.


Revision #2
Created 2026-03-07 09:57:16 UTC by Matthias
Updated 2026-03-07 10:03:04 UTC by Matthias