Skip to content

docs: minor tutorial fixes #3665

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 Oct 5, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ This may sound intricate, but it is super-useful and will grow on you.

## Types

The basic types include the usual boolean, integral, and floating point types.
The basic types include the usual boolean, integral, and floating-point types.

------------------------- -----------------------------------------------
`()` Nil, the type that has only a single value
Expand All @@ -367,8 +367,8 @@ The basic types include the usual boolean, integral, and floating point types.
`i8`, `i16`, `i32`, `i64` Signed integers with a specific size (in bits)
`u8`, `u16`, `u32`, `u64` Unsigned integers with a specific size
`float` The largest floating-point type efficiently supported on the target machine
`f32`, `f64` Floating-point types with a specific size.
`char` A Unicode character (32 bits).
`f32`, `f64` Floating-point types with a specific size
`char` A Unicode character (32 bits)
------------------------- -----------------------------------------------

These can be combined in composite types, which will be described in
Expand All @@ -378,7 +378,7 @@ while N should be a literal number):
------------------------- -----------------------------------------------
`[T * N]` Vector (like an array in other languages) with N elements
`[mut T * N]` Mutable vector with N elements
`(T1, T2)` Tuple type. Any arity above 1 is supported
`(T1, T2)` Tuple type; any arity above 1 is supported
`&T`, `~T`, `@T` [Pointer types](#boxes-and-pointers)
------------------------- -----------------------------------------------

Expand Down Expand Up @@ -863,7 +863,7 @@ the return type follows the arrow.

~~~~
fn line(a: int, b: int, x: int) -> int {
return a*x + b;
return a * x + b;
}
~~~~

Expand All @@ -874,7 +874,7 @@ expression.

~~~~
fn line(a: int, b: int, x: int) -> int {
a*x + b
a * x + b
}
~~~~

Expand All @@ -891,11 +891,11 @@ fn do_nothing_the_easy_way() { }
Ending the function with a semicolon like so is equivalent to returning `()`.

~~~~
fn line(a: int, b: int, x: int) -> int { a*x + b }
fn oops(a: int, b: int, x: int) -> () { a*x + b; }
fn line(a: int, b: int, x: int) -> int { a * x + b }
fn oops(a: int, b: int, x: int) -> () { a * x + b; }

assert 8 == line(5,3,1);
assert () == oops(5,3,1);
assert 8 == line(5, 3, 1);
assert () == oops(5, 3, 1);
~~~~

Methods are like functions, except that they are defined for a specific
Expand Down Expand Up @@ -1319,7 +1319,7 @@ Strings are implemented with vectors of `[u8]`, though they have a distinct
type. They support most of the same allocation options as
vectors, though the string literal without a storage sigil, e.g.
`"foo"` is treated differently than a comparable vector (`[foo]`).
Wheras plain vectors are stack-allocated fixed length vectors,
Whereas plain vectors are stack-allocated fixed-length vectors,
plain strings are region pointers to read-only memory.

~~~
Expand Down