I agree that they should be separate. A Tuple represents a generic
container object, whereas a Matrix is a specific kind of object with
certain algebraic properties. The fact that Tuple is only Basic
whereas ImmutableMatrix is also Expr showcases this fact (I know this
brings us back to the "meaning of Expr" discussion).
A Tuple might be thought of mathematically as an element of a
cartesian product set. As Joachim noted, it could contain anything:
mathematical expressions, boolean expressions, sets, other tuples,
etc. A Matrix has properties like a*(x, y, z) = (a*x, a*y, a*z).
This doesn't make sense if x, y, and z are all booleans, for example.
Another thing: if we define a nxm matrix by ((x11, x12, ..., x1m),
..., (xn1, xn2, ..., xnm)), then this could be seen as a column of row
vectors. So we see that depending on the context, we must consider a
tuple to be a row matrix or a column matrix.
If anything, ImmutableMatrix should subclass from Tuple, not the other
way around, since the latter is a more generic class.
What specific special cases are there in the code by the way?
Aaron Meurer