On Fri, Jun 06, 2003 at 02:15:19PM +0900, Yukihiro Matsumoto wrote:
> Keiju and others feel reluctant against making Matrix mutable.  I
> understand their feeling.  What do you think to use these muting
> methods for?  There might be different ways.

I do not understand their reluctance.  I see no good reason for Matrix
to be immutable.

As for where a mutable Matrix might be useful, consider:

  - Without []=, how can a (very large) Matrix be created incrementally?
    (it can be done, but the solution isn't pretty).  With []=,
    Matrix.diagonal() could be implemented in terms of []= instead of
    having to create a temporary array then copy that array into the
    Matrix.
  - Suppose I want to perform a particular transformation on a large
    Matrix.  Should it be necessary to make a copy of this large Matrix
    in order to perform the transformation?  Bear in mind that I may not
    even want to keep the original Matrix around.

If I want an immutable Matrix, I can always freeze it.

Paul