The Dot Access Operator : Uniform Syntax :
for access into any sequence type :
array vs tuple syntaxes :
in realm of consistency
let a: [u16; 4] = [ 1, 2, 3, 4];
let a = [ 1, 2, 3, 4];
// bracket syntax for array :
println!( “printing a fields {} , {}”, a[0], a[3]};
// dot syntax for array : why not?
println!( “printing a fields {} , {}”, a.0, a.3};
// array is a strict subset of type of tuple.
// it is a single, tuple can be a single as well
let b: (u16, u16, u16, u16) = (1, 2, 3, 4);
let b = (1, 2, 3, 4);
// repetition syntax : why not?
let b: (u16; 4) = (1, 2, 3, 4);
// as long as the type is the same, the compact syntax works fine.
// (u16; 4) means four slots of u16.