module Tuples {
// TUPLE BASICS
fn test1() {
// tuples are structural types with 2 or more anonymous fields. each field can be a different type.
// two tuples with the same set of fields are considered the same type.
// tuples are written using comma separated expressions between parens.
// tuples are immutable.
let x1 = (1, 2, 3); // tuple of 3 integers
let x2 = ("a", true); // tuple of a string and a bool
// to access a field of a tuple t, use t.n where n is the zero-based index of the field
let x3 = x1.1; // 2
let x4 = x1.0; // 1
// to write a tuple type, use the Tuple type and list the types of each field
// in the order they occur.
let x5 : (int, bool, string) = (1, true, "hi");
}
}