Description
The current modelling of List uses the same supertype for "normal" lists and for immutable and fixed-length lists, just with, e.g., operator[]= and an add method that throws.
I think it would be better modelling to have a base type for indexable values without those methods, but with extended types that include the operator[]= and add methods. Something like:
Tuple // Immutable and fixed length, has no add/removeLast or operator[]=
MutableTuple // Fixed length, has operator[]= but not add/removeLast
List // The current list - does it all.
("Tuple" is just a suggestion, I'm sure there are better names).
This way, a const<int>[2,4] would be a Tuple<int>, but [2,4] is a List<int>.
Something similar could be done for maps, and you probably don't even want the case where you can mutate the values but not change the keys.