|
|
|
|
|
by steveklabnik
311 days ago
|
|
It’s not so much that you’ve made any mistakes or omissions as much as all of these things do different, similar things, but don’t do the exact same thing. For example, an array and a tuple are both aggregate types, but arrays store multiple value of a single type, and tuples store multiple values of the same type. Some of these do boil down to “named or anonymous” but that’s also two different things. |
|
There are a lot of almost orthogonal features one might choose for a record type:
Accessor: rec.x, rec.0, rec[0], match
Constant vs Mutable
Reference vs Value
Nominal vs Structural/Anonymous typing
Subtyping for inheritance
Subtyping for sum/union types
And more depending on the language (ownership in Rust)
> tuples store multiple values of the same type.
I'm sure this was a typo. :-)