Remove mention of effect system from manual.
This commit is contained in:
parent
d2bd07dcb0
commit
b7d680b57d
@ -321,11 +321,9 @@ coupled to the loop that invoked it.
|
|||||||
@item Direct interface to C code
|
@item Direct interface to C code
|
||||||
|
|
||||||
Rust can load and call many C library functions simply by declaring
|
Rust can load and call many C library functions simply by declaring
|
||||||
them. Calling a C function statically marks a function as ``unsafe'', unless
|
them. Calling a C function is an ``unsafe'' action, and can only be taken
|
||||||
the task calling the unsafe function is further isolated within an external
|
within a block marked with the @code{unsafe} keyword. Every unsafe block
|
||||||
``heavyweight'' operating-system subprocess. Every ``unsafe'' function or
|
in a Rust compilation unit must be explicitly authorized in the crate file.
|
||||||
module in a Rust compilation unit must be explicitly authorized in the crate
|
|
||||||
file.
|
|
||||||
|
|
||||||
@sp 1
|
@sp 1
|
||||||
@item Structural algebraic data types
|
@item Structural algebraic data types
|
||||||
@ -684,7 +682,6 @@ The keywords are:
|
|||||||
@tab @code{const}
|
@tab @code{const}
|
||||||
@tab @code{thread}
|
@tab @code{thread}
|
||||||
@item @code{auth}
|
@item @code{auth}
|
||||||
@tab @code{impure}
|
|
||||||
@tab @code{unsafe}
|
@tab @code{unsafe}
|
||||||
@tab @code{self}
|
@tab @code{self}
|
||||||
@item @code{bind}
|
@item @code{bind}
|
||||||
@ -1490,7 +1487,7 @@ operating-system processes.
|
|||||||
@cindex Send expression
|
@cindex Send expression
|
||||||
@cindex Receive expression
|
@cindex Receive expression
|
||||||
|
|
||||||
With the exception of @emph{unsafe} constructs, Rust tasks are isolated from
|
With the exception of @emph{unsafe} blocks, Rust tasks are isolated from
|
||||||
interfering with one another's memory directly. Instead of manipulating shared
|
interfering with one another's memory directly. Instead of manipulating shared
|
||||||
storage, Rust tasks communicate with one another using a typed, asynchronous,
|
storage, Rust tasks communicate with one another using a typed, asynchronous,
|
||||||
simplex message-passing system.
|
simplex message-passing system.
|
||||||
@ -1788,7 +1785,6 @@ fn main() @{
|
|||||||
@c * Ref.Item.Fn:: Items defining functions.
|
@c * Ref.Item.Fn:: Items defining functions.
|
||||||
@cindex Functions
|
@cindex Functions
|
||||||
@cindex Slots, function input and output
|
@cindex Slots, function input and output
|
||||||
@cindex Effect of a function
|
|
||||||
@cindex Predicate
|
@cindex Predicate
|
||||||
|
|
||||||
|
|
||||||
@ -1809,10 +1805,6 @@ 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
|
implicit @code{ret} expression is appended to the end of the control path
|
||||||
during compilation, returning the implicit @code{()} value.
|
during compilation, returning the implicit @code{()} value.
|
||||||
|
|
||||||
A function may have an @emph{effect}, which may be either @code{impure} or
|
|
||||||
@code{unsafe}. If no effect is specified, the function is said to be
|
|
||||||
@dfn{pure}.
|
|
||||||
|
|
||||||
Any pure boolean function is also called a @emph{predicate}, and may be used
|
Any pure boolean function is also called a @emph{predicate}, and may be used
|
||||||
as part of the static typestate system. @xref{Ref.Typestate.Constr}.
|
as part of the static typestate system. @xref{Ref.Typestate.Constr}.
|
||||||
|
|
||||||
@ -2307,8 +2299,8 @@ by named reference to a @emph{tag item} declaration. @xref{Ref.Item.Tag}.
|
|||||||
|
|
||||||
The function type-constructor @code{fn} forms new function types. A function
|
The function type-constructor @code{fn} forms new function types. A function
|
||||||
type consists of a sequence of input slots, an optional set of input
|
type consists of a sequence of input slots, an optional set of input
|
||||||
constraints (@pxref{Ref.Typestate.Constr}), an output slot, and an
|
constraints (@pxref{Ref.Typestate.Constr}) and an output
|
||||||
@emph{effect}. @xref{Ref.Item.Fn}.
|
slot. @xref{Ref.Item.Fn}.
|
||||||
|
|
||||||
An example of a @code{fn} type:
|
An example of a @code{fn} type:
|
||||||
@example
|
@example
|
||||||
@ -2329,7 +2321,7 @@ x = bo(5,7);
|
|||||||
|
|
||||||
The iterator type-constructor @code{iter} forms new iterator types. An
|
The iterator type-constructor @code{iter} forms new iterator types. An
|
||||||
iterator type consists a sequence of input slots, an optional set of input
|
iterator type consists a sequence of input slots, an optional set of input
|
||||||
constraints, an output slot, and an @emph{effect}. @xref{Ref.Item.Iter}.
|
constraints and an output slot. @xref{Ref.Item.Iter}.
|
||||||
|
|
||||||
An example of an @code{iter} type:
|
An example of an @code{iter} type:
|
||||||
@example
|
@example
|
||||||
@ -2449,9 +2441,7 @@ that a variety of particular objects may conform to, by supporting a superset
|
|||||||
of the methods.
|
of the methods.
|
||||||
|
|
||||||
An object type that can contain fields of a given layer must be declared as
|
An object type that can contain fields of a given layer must be declared as
|
||||||
residing in that layer (or lower), like any other type. And similarly a method
|
residing in that layer (or lower), like any other type.
|
||||||
with a given effect must be declared as having that effect (or lower) in the
|
|
||||||
object type, like any other function.
|
|
||||||
|
|
||||||
An example of an object type with two separate object items supporting it, and
|
An example of an object type with two separate object items supporting it, and
|
||||||
a client function using both items via the object type:
|
a client function using both items via the object type:
|
||||||
@ -2460,17 +2450,17 @@ a client function using both items via the object type:
|
|||||||
|
|
||||||
state type taker =
|
state type taker =
|
||||||
state obj @{
|
state obj @{
|
||||||
impure fn take(int);
|
fn take(int);
|
||||||
@};
|
@};
|
||||||
|
|
||||||
state obj adder(mutable int x) @{
|
state obj adder(mutable int x) @{
|
||||||
impure fn take(int y) @{
|
fn take(int y) @{
|
||||||
x += y;
|
x += y;
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
|
|
||||||
obj sender(chan[int] c) @{
|
obj sender(chan[int] c) @{
|
||||||
impure fn take(int z) @{
|
fn take(int z) @{
|
||||||
c <| z;
|
c <| z;
|
||||||
@}
|
@}
|
||||||
@}
|
@}
|
||||||
@ -3191,10 +3181,6 @@ by the runtime or emitted to a system console. Log expressions are enabled or
|
|||||||
disabled dynamically at run-time on a per-task and per-item
|
disabled dynamically at run-time on a per-task and per-item
|
||||||
basis. @xref{Ref.Run.Log}.
|
basis. @xref{Ref.Run.Log}.
|
||||||
|
|
||||||
Executing a @code{log} expression is not considered an impure effect in the
|
|
||||||
effect system. In other words, a pure function remains pure even if it
|
|
||||||
contains a log expression.
|
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user