From: Dave Burt Date: 2006-09-12T18:20:40+09:00 Subject: Re: Matrix Michael Ulm wrote: > Just Another Victim of the Ambient Morality wrote: > >> "MonkeeSage" wrote in message >> n = 3 >> n = n + 1 >> >> >> Matrices are no different and, so, you can do: >> >> >> n = Matrix.scalar(2, 3) >> n = n + Matrix.I(2) >> >> >> In both cases, the "number" types are immutable but the references >> to them are not, as you say. They both work exactly the same way. >> What are you trying to say? >> >> > > I think he's trying to say, that there is no rational reason for > leaving out the []= operator, and I agree. The benefit is that you can assume no other code is modifying your matrix. n = Matrix.I(2) some_function(n) p n # same as before It's a good feature. []= would be useful, too, but I think to keep the immutability a better addition that provides the same functionality could be provided; a modified_at(x,y,value) method or something, but naming it is hard. Cheers, Dave