Skip to content

Link to explanations of r-value, l-value and lint #152

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 2 commits into from
Jul 3, 2014
Merged
Show file tree
Hide file tree
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
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