Replace all occurrences of 'when' with 'if' in documentation and tutorial.

Also update the naturaldocs keywords file.

Closes #1396
This commit is contained in:
Austin Seipp 2012-01-09 19:32:54 -06:00 committed by Brian Anderson
parent 070b1c8333
commit 55edb4a04f
3 changed files with 4 additions and 4 deletions

View File

@ -17,4 +17,4 @@ self str syntax
tag true type
u16 u32 u64 u8 uint unchecked unsafe use
vec
when while with
while with

View File

@ -3331,12 +3331,12 @@ let message = alt x @{
Finally, alt patterns can accept @emph{pattern guards} to further refine the
criteria for matching a case. Pattern guards appear after the pattern and
consist of a bool-typed expression following the @emph{when} keyword. A pattern
consist of a bool-typed expression following the @emph{if} keyword. A pattern
guard may refer to the variables bound within the pattern they follow.
@example
let message = alt maybe_digit @{
some(x) when x < 10 @{ process_digit(x) @}
some(x) if x < 10 @{ process_digit(x) @}
some(x) @{ process_other(x) @}
@}
@end example

View File

@ -67,7 +67,7 @@ that `(float, float)` is a tuple of two floats:
fn angle(vec: (float, float)) -> float {
alt vec {
(0f, y) when y < 0f { 1.5 * std::math::pi }
(0f, y) if y < 0f { 1.5 * std::math::pi }
(0f, y) { 0.5 * std::math::pi }
(x, y) { std::math::atan(y / x) }
}