Skip to content

Commit

Permalink
Added link in glossary to expression-oriented language
Browse files Browse the repository at this point in the history
Tidied up glossary.md and added link from hello-world.md to
'expression-oriented language' in glossary.md
  • Loading branch information
Dangthrimble committed Jul 24, 2015
1 parent 30584b0 commit bcee0a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
20 changes: 10 additions & 10 deletions src/doc/trpl/glossary.md
Expand Up @@ -48,16 +48,16 @@ expression might perform actions other than simply returning a value.

### Expression-Oriented Language

In early programming languages [expressions] and [statements] were two separate
syntactic categories: expressions had a value and statements did things.
However, later languages blurred this distinction, allowing expressions to do
things and statements to have a value. In an expression-oriented language,
(nearly) every statement is an expression and therefore returns a value.
Consequently these expression statements can themselves form part of larger
expressions.

[expressions]: glossary.html#expression
[statements]: glossary.html#statement
In early programming languages [expressions][expression] and
[statements][statement] were two separate syntactic categories: expressions had
a value and statements did things. However, later languages blurred this
distinction, allowing expressions to do things and statements to have a value.
In an expression-oriented language, (nearly) every statement is an expression
and therefore returns a value. Consequently these expression statements can
themselves form part of larger expressions.

[expression]: glossary.html#expression
[statement]: glossary.html#statement

### Statement

Expand Down
11 changes: 7 additions & 4 deletions src/doc/trpl/hello-world.md
Expand Up @@ -111,10 +111,13 @@ string to the screen. Easy enough!

[allocation]: the-stack-and-the-heap.html

Finally, the line ends with a semicolon (`;`). Rust is an ‘expression oriented’
language, which means that most things are expressions, rather than statements.
The `;` is used to indicate that this expression is over, and the next one is
ready to begin. Most lines of Rust code end with a `;`.
Finally, the line ends with a semicolon (`;`). Rust is an [‘expression oriented’
language][expression-oriented language], which means that most things are
expressions, rather than statements. The `;` is used to indicate that this
expression is over, and the next one is ready to begin. Most lines of Rust code
end with a `;`.

[expression-oriented language]: glossary.html#expression-oriented-language

Finally, actually compiling and running our program. We can compile with our
compiler, `rustc`, by passing it the name of our source file:
Expand Down

0 comments on commit bcee0a8

Please sign in to comment.