-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rewrite the macros chapter #22393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite the macros chapter #22393
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
* `ty`: a type. Examples: `i32`; `Vec<(char, String)>`; `&T`. | ||
* `pat`: a pattern. Examples: `Some(t)`; `(17, 'a')`; `_`. | ||
* `stmt`: a single statement. Example: `let x = 3`. | ||
* `block`: a sequence of statements. Example: `{ log(error, "hi"); return 12; }`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a delimited sequence of statements.
Nice words. |
($inp:expr, [ $($sp:path),+ ]) => ( | ||
match $inp { | ||
By now you've learned about many of the tools Rust provides for abstracting and | ||
reusing code. These units of code reuse have a rich semantic structure. For |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one period after spaces, this is off everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Old habits die hard :3
Some nits, but overall, r=me. Thanks for working on this! |
related: #19554 |
This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III.
80e1197
to
6cef0e5
Compare
This failed to merge into the rollup; you might have to rebase. |
Conflict wasn't tough to resolve, you're in the rollup now! 😺 |
…eklabnik This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III. Conflicts: src/doc/trpl/macros.md
This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III.