Skip to content

Commit

Permalink
Merge pull request #152 from vks/links
Browse files Browse the repository at this point in the history
Link to explanations of r-value, l-value and lint
  • Loading branch information
Jorge Aparicio committed Jul 3, 2014
2 parents 5ee3aaf + 32af281 commit 704a37b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/attribute/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ can be used to/for:
<!-- TODO: Link these to their respective examples -->
* [conditional compilation of code](/attribute/cfg.html)
* [set crate name, version and type (binary or library)](/attribute/crate.html)
* disable lints (warnings)
* disable [lints](https://en.wikipedia.org/wiki/Lint_%28software%29) (warnings)
* enable compiler features (macros, glob imports, etc.)
* link to a foreign library
* mark functions as unit tests
Expand Down
9 changes: 6 additions & 3 deletions examples/expression/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ In Rust, almost every statement is an expression, this means that the statement
returns a value. This may not always be desired, so the output can be
suppressed by ending the expression with a semicolon `;`.

Block are expressions too, so they can be used as r-values in assignments. The
last expression in the block will be assigned to the l-value. But, if the last
expression of the block ends with a semicolon, the return value will be `()`.
Block are expressions too, so they can be used as
[r-values](https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue)
in assignments. The last expression in the block will be assigned to the
[l-value](https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue).
But, if the last expression of the block ends with a semicolon, the return
value will be `()`.

{expression.play}
5 changes: 3 additions & 2 deletions examples/fn/unused/input.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
The compiler provides a `dead_code` *lint* that will warn about unused
functions. An *attribute* can be used to disable the lint.
The compiler provides a `dead_code`
[*lint*](https://en.wikipedia.org/wiki/Lint_%28software%29) that will warn
about unused functions. An *attribute* can be used to disable the lint.

{unused.play}

Expand Down
7 changes: 4 additions & 3 deletions examples/type/inference/input.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
The type inference engine is pretty smart. It does more than looking at the
type of the r-value during an initialization. It also looks how the variable is
used afterwards to infer its type. Here's an advanced example of type
inference:
type of the
[r-value](https://en.wikipedia.org/wiki/Value_%28computer_science%29#lrvalue)
during an initialization. It also looks how the variable is used afterwards to
infer its type. Here's an advanced example of type inference:

{inference.play}

Expand Down

0 comments on commit 704a37b

Please sign in to comment.