Skip to content

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

Merged
merged 1 commit into from
Feb 18, 2015
Merged

Conversation

kmcallister
Copy link
Contributor

This is a more introductory document, suitable for Part II. The arcane details move to an "Advanced macros" chapter in Part III.

@kmcallister
Copy link
Contributor Author

r? @steveklabnik

@rust-highfive
Copy link
Contributor

r? @alexcrichton

(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; }`.
Copy link
Contributor

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.

@brson
Copy link
Contributor

brson commented Feb 16, 2015

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
Copy link
Member

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

Copy link
Contributor Author

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

@steveklabnik
Copy link
Member

Some nits, but overall, r=me. Thanks for working on this!

@steveklabnik
Copy link
Member

related: #19554

This is a more introductory document, suitable for Part II.  The arcane details
move to an "Advanced macros" chapter in Part III.
@kmcallister
Copy link
Contributor Author

@bors r=steveklabnik 6cef0e5 rollup

@Manishearth
Copy link
Member

This failed to merge into the rollup; you might have to rebase.

@Manishearth
Copy link
Member

Conflict wasn't tough to resolve, you're in the rollup now! 😺

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 17, 2015
…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
@huonw huonw merged commit 6cef0e5 into rust-lang:master Feb 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants