From 8fb77c70993b8f020a9398a458e9a6aea02eb70b Mon Sep 17 00:00:00 2001 From: gifnksm Date: Tue, 23 Jul 2013 11:01:21 +0900 Subject: [PATCH 1/3] tutorial: Repair broken links --- doc/tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 898811dc3a6..8c2b5733ed0 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -309,7 +309,7 @@ was taken. In short, everything that's not a declaration (declarations are `let` for variables; `fn` for functions; and any top-level named items such as -[traits](#traits), [enum types](#enums), and [constants](#constants)) is an +[traits](#traits), [enum types](#enums), and static items) is an expression, including function bodies. ~~~~ @@ -1374,7 +1374,7 @@ let exchange_crayons: ~str = ~"Black, BlizzardBlue, Blue"; ~~~ Both vectors and strings support a number of useful -[methods](#functions-and-methods), defined in [`std::vec`] +[methods](#methods), defined in [`std::vec`] and [`std::str`]. Here are some examples. [`std::vec`]: std/vec.html @@ -1928,7 +1928,7 @@ that implements a trait includes the name of the trait at the start of the definition, as in the following impls of `Printable` for `int` and `~str`. -[impls]: #functions-and-methods +[impls]: #methods ~~~~ # trait Printable { fn print(&self); } From 9aab7e59d752a2ac14e62e309d58f5eb9a60266d Mon Sep 17 00:00:00 2001 From: gifnksm Date: Tue, 23 Jul 2013 11:02:07 +0900 Subject: [PATCH 2/3] tutorial: Fix obsolete names --- doc/tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 8c2b5733ed0..5277c13ab9a 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -992,7 +992,7 @@ task-local garbage collector. It will be destroyed at some point after there are no references left to the box, no later than the end of the task. Managed boxes lack an owner, so they start a new ownership tree and don't inherit mutability. They do own the contained object, and mutability is defined by the -type of the shared box (`@` or `@mut`). An object containing a managed box is +type of the managed box (`@` or `@mut`). An object containing a managed box is not `Owned`, and can't be sent between tasks. ~~~~ @@ -1089,8 +1089,8 @@ we might like to compute the distance between `on_the_stack` and to define a function that takes two arguments of type point—that is, it takes the points by value. But this will cause the points to be copied when we call the function. For points, this is probably not so -bad, but often copies are expensive or, worse, if there are mutable -fields, they can change the semantics of your program. So we’d like to +bad, but often copies are expensive or, worse, if copied data are in mutable +slots, they can change the semantics of your program. So we’d like to define a function that takes the points by pointer. We can use borrowed pointers to do this: From e68697b55e0b89c72ab52e7a8004cc1ceb7619ff Mon Sep 17 00:00:00 2001 From: gifnksm Date: Tue, 23 Jul 2013 12:17:42 +0900 Subject: [PATCH 3/3] tutorial: Remove the sentence about mutable fields. --- doc/tutorial.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 5277c13ab9a..de11a297d89 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1089,10 +1089,8 @@ we might like to compute the distance between `on_the_stack` and to define a function that takes two arguments of type point—that is, it takes the points by value. But this will cause the points to be copied when we call the function. For points, this is probably not so -bad, but often copies are expensive or, worse, if copied data are in mutable -slots, they can change the semantics of your program. So we’d like to -define a function that takes the points by pointer. We can use -borrowed pointers to do this: +bad, but often copies are expensive. So we’d like to define a function +that takes the points by pointer. We can use borrowed pointers to do this: ~~~ # struct Point { x: float, y: float }