@@ -120,7 +120,7 @@ table. The task ahead involves combining, trimming, and implementing.
120
120
@end quotation
121
121
@sp 2
122
122
123
- Rust is a curly-brace, block-structured statement language. It visually
123
+ Rust is a curly-brace, block-structured expression language. It visually
124
124
resembles the C language family, but differs significantly in syntactic and
125
125
semantic details. Its design is oriented toward concerns of ``programming in
126
126
the large'', that is, of creating and maintaining @emph {boundaries } -- both
@@ -334,7 +334,7 @@ The Rust type system is primarily structural, and contains the standard
334
334
assortment of useful ``algebraic'' type constructors from functional
335
335
languages, such as function types, tuples, record types, vectors, and
336
336
nominally-tagged disjoint unions. Such values may be @emph {pattern-matched } in
337
- an @code {alt } statement .
337
+ an @code {alt } expression .
338
338
339
339
@sp 1
340
340
@item Generic code
@@ -394,8 +394,8 @@ the surrounding text by skipping over the bracketed ``extension text''.
394
394
@sp 1
395
395
@item Idempotent failure
396
396
397
- If a task fails due to a signal, or if it executes the special @code {fail }
398
- statement , it enters the @emph {failing } state. A failing task unwinds its
397
+ If a task fails due to a signal, or if it evaluates the special @code {fail }
398
+ expression , it enters the @emph {failing } state. A failing task unwinds its
399
399
control stack, frees all of its owned resources (executing destructors) and
400
400
enters the @emph {dead } state. Failure is idempotent and non-recoverable.
401
401
@@ -1486,8 +1486,8 @@ operating-system processes.
1486
1486
@cindex Port
1487
1487
@cindex Channel
1488
1488
@cindex Message passing
1489
- @cindex Send statement
1490
- @cindex Receive statement
1489
+ @cindex Send expression
1490
+ @cindex Receive expression
1491
1491
1492
1492
With the exception of @emph {unsafe } constructs, Rust tasks are isolated from
1493
1493
interfering with one another's memory directly. Instead of manipulating shared
@@ -1563,14 +1563,14 @@ A task begins its lifecycle -- once it has been spawned -- in the
1563
1563
function, and any functions called by the entry function.
1564
1564
1565
1565
A task may transition from the @emph {running } state to the @emph {blocked }
1566
- state any time it executes a communication statement on a port or channel that
1567
- cannot be immediately completed. When the communication statement can be
1566
+ state any time it evaluates a communication expression on a port or channel that
1567
+ cannot be immediately completed. When the communication expression can be
1568
1568
completed -- when a message arrives at a sender, or a queue drains
1569
1569
sufficiently to complete a semi-synchronous send -- then the blocked task will
1570
1570
unblock and transition back to @emph {running }.
1571
1571
1572
1572
A task may transition to the @emph {failing } state at any time, due to an
1573
- un-trapped signal or the execution of a @code {fail } statement . Once
1573
+ un-trapped signal or the evaluation of a @code {fail } expression . Once
1574
1574
@emph {failing }, a task unwinds its stack and transitions to the @emph {dead }
1575
1575
state. Unwinding the stack of a task is done by the task itself, on its own
1576
1576
control stack. If a value with a destructor is freed during unwinding, the
@@ -1804,8 +1804,8 @@ otherwise exactly as a function item (with a minor additional cost of calling
1804
1804
the function, as such a call is indirect). @xref {Ref.Type.Fn }.
1805
1805
1806
1806
Every control path in a function ends with either a @code {ret } or @code {be }
1807
- statement . If a control path lacks a @code {ret } statement in source code, an
1808
- implicit @code {ret } statement is appended to the end of the control path
1807
+ expression . If a control path lacks a @code {ret } expression in source code, an
1808
+ implicit @code {ret } expression is appended to the end of the control path
1809
1809
during compilation, returning the implicit @code {() } value.
1810
1810
1811
1811
A function may have an @emph {effect }, which may be either @code {impure } or
@@ -1827,9 +1827,9 @@ fn add(int x, int y) -> int @{
1827
1827
@c * Ref.Item.Iter:: Items defining iterators.
1828
1828
1829
1829
@cindex Iterators
1830
- @cindex Put statement
1831
- @cindex Put each statement
1832
- @cindex Foreach statement
1830
+ @cindex Put expression
1831
+ @cindex Put each expression
1832
+ @cindex Foreach expression
1833
1833
1834
1834
Iterators are function-like items that can @code {put } multiple values during
1835
1835
their execution before returning or tail-calling.
@@ -1841,11 +1841,11 @@ but the iterator frame is only @emph{suspended} during the put, and will be
1841
1841
the caller's loop.
1842
1842
1843
1843
The output type of an iterator is the type of value that the function will
1844
- @code {put }, before it eventually executes a @code {ret } or @code {be } statement
1844
+ @code {put }, before it eventually evaluates a @code {ret } or @code {be } expression
1845
1845
of type @code {() } and completes its execution.
1846
1846
1847
1847
An iterator can only be called in the loop header of a matching @code {for
1848
- each } loop or as the argument in a @code {put each } statement .
1848
+ each } loop or as the argument in a @code {put each } expression .
1849
1849
@xref {Ref.Stmt.Foreach }.
1850
1850
1851
1851
An example of an iterator:
@@ -2052,13 +2052,13 @@ Rust; they cannot be used as user-defined identifiers in any context.
2052
2052
@cindex Any type
2053
2053
@cindex Dynamic type , see @i {Any type }
2054
2054
@cindex Reflection
2055
- @cindex Alt type statement
2055
+ @cindex Alt type expression
2056
2056
2057
2057
The type @code {any } is the union of all possible Rust types. A value of type
2058
2058
@code {any } is represented in memory as a pair consisting of a boxed value of
2059
2059
some non-@code {any } type @var {T } and a reflection of the type @var {T }.
2060
2060
2061
- Values of type @code {any } can be used in an @code {alt type } statement , in
2061
+ Values of type @code {any } can be used in an @code {alt type } expression , in
2062
2062
which the reflection is used to select a block corresponding to a particular
2063
2063
type extraction. @xref {Ref.Stmt.Alt }.
2064
2064
@@ -2549,7 +2549,7 @@ right hand side of copy statements, @xref{Ref.Stmt.Copy}.
2549
2549
@c * Ref.Stmt:: Executable statements.
2550
2550
@cindex Statements
2551
2551
2552
- A @dfn {statement } is a component of a block, which is in turn a components of
2552
+ A @dfn {statement } is a component of a block, which is in turn a component of
2553
2553
an outer block, a function or an iterator. When a function is spawned into a
2554
2554
task, the task @emph {executes } statements in an order determined by the body
2555
2555
of the enclosing structure. Each statement causes the task to perform certain
0 commit comments