Skip to content
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

More statement-to-expression edits #309

Merged
merged 1 commit into from
Apr 5, 2011
Merged
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
20 changes: 10 additions & 10 deletions doc/rust.texi
Original file line number Diff line number Diff line change
Expand Up @@ -1804,8 +1804,8 @@ otherwise exactly as a function item (with a minor additional cost of calling
the function, as such a call is indirect). @xref{Ref.Type.Fn}.

Every control path in a function ends with either a @code{ret} or @code{be}
statement. If a control path lacks a @code{ret} statement in source code, an
implicit @code{ret} statement is appended to the end of the control path
expression. If a control path lacks a @code{ret} expression in source code, an
implicit @code{ret} expression is appended to the end of the control path
during compilation, returning the implicit @code{()} value.

A function may have an @emph{effect}, which may be either @code{impure} or
Expand All @@ -1827,9 +1827,9 @@ fn add(int x, int y) -> int @{
@c * Ref.Item.Iter:: Items defining iterators.

@cindex Iterators
@cindex Put statement
@cindex Put each statement
@cindex Foreach statement
@cindex Put expression
@cindex Put each expression
@cindex Foreach expression

Iterators are function-like items that can @code{put} multiple values during
their execution before returning or tail-calling.
Expand All @@ -1841,11 +1841,11 @@ but the iterator frame is only @emph{suspended} during the put, and will be
the caller's loop.

The output type of an iterator is the type of value that the function will
@code{put}, before it eventually executes a @code{ret} or @code{be} statement
@code{put}, before it eventually evaluates a @code{ret} or @code{be} expression
of type @code{()} and completes its execution.

An iterator can only be called in the loop header of a matching @code{for
each} loop or as the argument in a @code{put each} statement.
each} loop or as the argument in a @code{put each} expression.
@xref{Ref.Stmt.Foreach}.

An example of an iterator:
Expand Down Expand Up @@ -2052,13 +2052,13 @@ Rust; they cannot be used as user-defined identifiers in any context.
@cindex Any type
@cindex Dynamic type, see @i{Any type}
@cindex Reflection
@cindex Alt type statement
@cindex Alt type expression

The type @code{any} is the union of all possible Rust types. A value of type
@code{any} is represented in memory as a pair consisting of a boxed value of
some non-@code{any} type @var{T} and a reflection of the type @var{T}.

Values of type @code{any} can be used in an @code{alt type} statement, in
Values of type @code{any} can be used in an @code{alt type} expression, in
which the reflection is used to select a block corresponding to a particular
type extraction. @xref{Ref.Stmt.Alt}.

Expand Down Expand Up @@ -2549,7 +2549,7 @@ right hand side of copy statements, @xref{Ref.Stmt.Copy}.
@c * Ref.Stmt:: Executable statements.
@cindex Statements

A @dfn{statement} is a component of a block, which is in turn a components of
A @dfn{statement} is a component of a block, which is in turn a component of
an outer block, a function or an iterator. When a function is spawned into a
task, the task @emph{executes} statements in an order determined by the body
of the enclosing structure. Each statement causes the task to perform certain
Expand Down