(T1, T2, ...). They occupy multiple TVM stack entries sequentially and are serialized in the same order. For example, (int, slice) represents two values following one another.
Tensors are anonymous structures and behave identically. Large tensors are impractical — use structures whenever possible.
Component access
Usetensor.{i} to access tensor components by their index:
Tensors as anonymous structures
The structUser below and a tensor (int, slice) have identical stack layouts and serialization rules:
obj.{field} is equivalent to tensor.{i}:
Destructuring assignments
The following syntax is valid:(10, 20) assigned to two variables:
("abcd", (10, 20)) and ("abcd", 10, 20) are placed identically as three stack entries containing the values "abcd" (as a slice), 10, and 20, respectively. However, Tolk treats (slice, (int, int)) and (slice, int, int) as distinct types.
_ can be used on the left side to discard a destructured value: