@@ -692,8 +692,7 @@ The keywords are:
692
692
@tab @code {i32 }
693
693
@tab @code {i64 }
694
694
@tab @code {f64 }
695
- @item @code {rec }
696
- @tab @code {tup }
695
+ @item @code {tup }
697
696
@tab @code {tag }
698
697
@tab @code {vec }
699
698
@tab @code {str }
@@ -1349,7 +1348,7 @@ Alias slots are indicated by the @emph{ampersand} sigil @code{&}.
1349
1348
1350
1349
An example function that accepts an alias parameter:
1351
1350
@example
1352
- type point3d = rec(int x, int y, int z) ;
1351
+ type point3d = @{ x: int, y: int, z: int @} ;
1353
1352
1354
1353
fn extract_z(&point3d p) -> int @{
1355
1354
ret p.z;
@@ -2006,7 +2005,7 @@ aspects of a value include:
2006
2005
@item The storage layer the value resides in (immutable, state or gc).
2007
2006
@end itemize
2008
2007
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
2010
2009
values that are composite records, each containing two unsigned 8-bit integers
2011
2010
accessed through the components @code {x } and @code {y }, and laid out in memory
2012
2011
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
2257
2256
@cindex Record types
2258
2257
@cindex Structure types , see @i {Record types }
2259
2258
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.
2266
2265
2267
- An example of a @code { rec } type and its use:
2266
+ An example of a record type and its use:
2268
2267
@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 @} ;
2271
2270
let int px = p.x;
2272
2271
@end example
2273
2272
@@ -2276,7 +2275,7 @@ let int px = p.x;
2276
2275
@cindex Tuple types
2277
2276
2278
2277
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
2280
2279
that tuple members are automatically assigned implicit field names, given by
2281
2280
ascending integers prefixed by the underscore character: @code {_0 }, @code {_1 },
2282
2281
@code {_2 }, etc. The members of a tuple are laid out in memory contiguously,
@@ -2553,12 +2552,12 @@ declared. @xref{Ref.Expr.Check}.
2553
2552
2554
2553
An example of a constrained type with two separate instantiations:
2555
2554
@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);
2557
2556
2558
- let ordered_range rng1 = rec( low= 5, high=7) ;
2557
+ let ordered_range rng1 = @{ low: 5, high: 7 @} ;
2559
2558
// implicit: 'check less_than(rng1.low, rng1.high);'
2560
2559
2561
- let ordered_range rng2 = rec( low= 15, high=17) ;
2560
+ let ordered_range rng2 = @{ low: 15, high: 17 @} ;
2562
2561
// implicit: 'check less_than(rng2.low, rng2.high);'
2563
2562
@end example
2564
2563
0 commit comments