Skip to content

Commit bcee0a8

Browse files
committed
Added link in glossary to expression-oriented language
Tidied up glossary.md and added link from hello-world.md to 'expression-oriented language' in glossary.md
1 parent 30584b0 commit bcee0a8

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/doc/trpl/glossary.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ expression might perform actions other than simply returning a value.
4848

4949
### Expression-Oriented Language
5050

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

6262
### Statement
6363

src/doc/trpl/hello-world.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,13 @@ string to the screen. Easy enough!
111111

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

114-
Finally, the line ends with a semicolon (`;`). Rust is an ‘expression oriented’
115-
language, which means that most things are expressions, rather than statements.
116-
The `;` is used to indicate that this expression is over, and the next one is
117-
ready to begin. Most lines of Rust code end with a `;`.
114+
Finally, the line ends with a semicolon (`;`). Rust is an [‘expression oriented’
115+
language][expression-oriented language], which means that most things are
116+
expressions, rather than statements. The `;` is used to indicate that this
117+
expression is over, and the next one is ready to begin. Most lines of Rust code
118+
end with a `;`.
119+
120+
[expression-oriented language]: glossary.html#expression-oriented-language
118121

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

0 commit comments

Comments
 (0)