Tuples
A tuple can combine multiple values of different types into a single compound value. Tuple types are represented as (T1, T2, ..., TN), where T1 through TN can be any type, separated by commas.
A tuple must have at least two elements. For example, (Int64, Float64) is a 2-tuple (pair), and (Int64, Float64, String) is a 3-tuple (triple). The length of a tuple is fixed after definition and cannot be changed.
Tuples are immutable types—once a tuple instance is created, individual elements cannot be modified. However, tuple variables declared with var can be reassigned as a whole. Elements are accessed via t[index], with indexing starting from 0.
(name: String, price: Int64), name cannot be used directly as an accessor.Run the code on the right to observe tuple creation, index access, and destructuring. Try assigning a value to point[0] to see what error you get.