4 ms·
The Little Book of Rust Macros is a pretty good, but dense, overview of how macro_rules! can be used. (Procedural macros are a completely different beast). ht
by kd5bjo 6y ago
The Little Book of Rust Macros is a pretty good, but dense, overview of how macro_rules! can be used. (Procedural macros are a completely different beast).
https://danielkeep.github.io/tlborm/book/index.html https://danielkeep.github.io/tlborm/book/index.html
- 65536 6y agoAlso, there are a lot of uses of macro_rules! in the Rust compiler and standard library repository. https://github.com/rust-lang/rust/search?q=macro_rules&type= https://github.com/rust-lang/rust/search?q=macro_rules&type= Looking at some of those and reading https://doc.rust-lang.org/rust-by-example/macros/syntax.html https://doc.rust-lang.org/rust-by-example/macros/syntax.html and https://doc.rust-lang.org/reference/macros-by-example.html https://doc.rust-lang.org/reference/macros-by-example.html can potentially be instructive.