by mrbluecoat · 1y ago · 0 comments
(int,bool,bool) t = (1, true, false) // v: Define a tuple. Access elements using t[0], t[1], t[2]
string? s = null
The tup is an interesting question. I often think about tup(int, bool, string) vs (int, bool, string). I convince myself that there might be a better choice.
`var t = (1 as i8, true, false)` Use automatic inference to replace active type declarations.
t.0 vs t[0] is equally difficult to choose, but t[0] is the more commonly used syntax. Using t[n] consistently across map/vec/set/tup might be the more correct decision.
The tuple type definition _looks_ like how the tuple will look. The nullable indicator is a symbol with a delightfully appropriate semantic meaning.