3 ms·
Macro definitions can be hard to grok, but that's not usually what you look on. Macro uses can be hard, but macros are not used commonly in Rust (I mean, there
by afdbcreid 5y ago
Macro definitions can be hard to grok, but that's not usually what you look on.
Macro uses can be hard, but macros are not used commonly in Rust (I mean, there are not many macros - but those that exist are very common). And they also look very much like Rust: `vec![a, b, c]` vs. `[a, b, c]`, `zip!(a, b, c)` (itertools) vs. `zip(a, b)` (`std::iter::zip()`), `#[tokio::main] async fn main() {}` vs `fn main() {}`...
Attribute procedural macros only accept valid Rust syntax, and most of them are derive macros that just derive some trait.