mirror of
https://github.com/rust-lang/rust
synced 2024-11-02 11:53:40 +00:00
Talk about ends, rather than means, in macro tutorial introduction.
This commit is contained in:
parent
837875711a
commit
4edb881124
1 changed files with 5 additions and 5 deletions
|
@ -2,11 +2,11 @@
|
|||
|
||||
# Introduction
|
||||
|
||||
Functions are the primary tool that programmers can use to build
|
||||
abstractions. Sometimes, though, programmers want to abstract over
|
||||
compile-time, syntactic structures rather than runtime values. For example,
|
||||
the following two code fragments both pattern-match on their input and return
|
||||
early in one case, doing nothing otherwise:
|
||||
Functions are the primary tool that programmers can use to build abstractions.
|
||||
Sometimes, however, programmers want to perform abstractions over things that are not
|
||||
runtime values. Macros provide a syntactic abstraction. For an example of how this
|
||||
can be useful, consider the following two code fragments, which both pattern-match
|
||||
on their input and return early in one case, and do nothing otherwise:
|
||||
|
||||
~~~~
|
||||
# enum t { special_a(uint), special_b(uint) };
|
||||
|
|
Loading…
Reference in a new issue