Skip to content

Commit 90cc1ed

Browse files
committed
---
yaml --- r: 4523 b: refs/heads/master c: c659ba4 h: refs/heads/master i: 4521: 8e472be 4519: a0dc27a v: v3
1 parent da1fa1d commit 90cc1ed

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 8bc42917645669ba0453e23d7c930e3671a5cfad
2+
refs/heads/master: c659ba41186325f75750be5c0d3f5e8991f2077a

trunk/doc/rust.texi

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,7 @@ The keywords are:
692692
@tab @code{i32}
693693
@tab @code{i64}
694694
@tab @code{f64}
695-
@item @code{rec}
696-
@tab @code{tup}
695+
@item @code{tup}
697696
@tab @code{tag}
698697
@tab @code{vec}
699698
@tab @code{str}
@@ -1349,7 +1348,7 @@ Alias slots are indicated by the @emph{ampersand} sigil @code{&}.
13491348

13501349
An example function that accepts an alias parameter:
13511350
@example
1352-
type point3d = rec(int x, int y, int z);
1351+
type point3d = @{x: int, y: int, z: int@};
13531352
13541353
fn extract_z(&point3d p) -> int @{
13551354
ret p.z;
@@ -2006,7 +2005,7 @@ aspects of a value include:
20062005
@item The storage layer the value resides in (immutable, state or gc).
20072006
@end itemize
20082007

2009-
For example, the type @code{rec(u8 x, u8 y)} defines the set of immutable
2008+
For example, the type @code{@{x: u8, y: u8@}} defines the set of immutable
20102009
values that are composite records, each containing two unsigned 8-bit integers
20112010
accessed through the components @code{x} and @code{y}, and laid out in memory
20122011
with the @code{x} component preceding the @code{y} component.
@@ -2257,17 +2256,17 @@ A value of type @code{str} is a Unicode string, represented as a vector of
22572256
@cindex Record types
22582257
@cindex Structure types, see @i{Record types}
22592258

2260-
The record type-constructor @code{rec} forms a new heterogeneous product of
2261-
values.@footnote{The @code{rec} type-constructor is analogous to the
2262-
@code{struct} type-constructor in the Algol/C family, the @emph{record} types
2263-
of the ML family, or the @emph{structure} types of the Lisp family.} Fields of
2264-
a @code{rec} type are accessed by name and are arranged in memory in the order
2265-
specified by the @code{rec} type.
2259+
The record type-constructor forms a new heterogeneous product of
2260+
values.@footnote{The record type-constructor is analogous to the @code{struct}
2261+
type-constructor in the Algol/C family, the @emph{record} types of the ML
2262+
family, or the @emph{structure} types of the Lisp family.} Fields of a record
2263+
type are accessed by name and are arranged in memory in the order specified by
2264+
the record type.
22662265

2267-
An example of a @code{rec} type and its use:
2266+
An example of a record type and its use:
22682267
@example
2269-
type point = rec(int x, int y);
2270-
let point p = rec(x=10, y=11);
2268+
type point = @{x: int, y: int@};
2269+
let point p = @{x: 10, y: 11@};
22712270
let int px = p.x;
22722271
@end example
22732272

@@ -2276,7 +2275,7 @@ let int px = p.x;
22762275
@cindex Tuple types
22772276

22782277
The tuple type-constructor @code{tup} forms a new heterogeneous product of
2279-
values exactly as the @code{rec} type-constructor does, with the difference
2278+
values exactly as the record type-constructor does, with the difference
22802279
that tuple members are automatically assigned implicit field names, given by
22812280
ascending integers prefixed by the underscore character: @code{_0}, @code{_1},
22822281
@code{_2}, etc. The members of a tuple are laid out in memory contiguously,
@@ -2553,12 +2552,12 @@ declared. @xref{Ref.Expr.Check}.
25532552

25542553
An example of a constrained type with two separate instantiations:
25552554
@example
2556-
type ordered_range = rec(int low, int high) : less_than(*.low, *.high);
2555+
type ordered_range = @{low: int, high: int@} : less_than(*.low, *.high);
25572556
2558-
let ordered_range rng1 = rec(low=5, high=7);
2557+
let ordered_range rng1 = @{low: 5, high: 7@};
25592558
// implicit: 'check less_than(rng1.low, rng1.high);'
25602559
2561-
let ordered_range rng2 = rec(low=15, high=17);
2560+
let ordered_range rng2 = @{low: 15, high: 17@};
25622561
// implicit: 'check less_than(rng2.low, rng2.high);'
25632562
@end example
25642563

0 commit comments

Comments
 (0)