Issue #14151 has been updated by mame (Yusuke Endoh).


It is difficult for me to explain that all numeric objects are (basically) immutable because it looks obvious to me...  "The Ruby Programming Language" by David Flanagan, Yukihiro Matsumoto, says:

> All numeric objects are immutable; there are no methods that allow you to change the
value held by the object.

I know Matlab and SciPy people are familiar with mutable matrices.  For such people, there is NArray.

----------------------------------------
Feature #14151: Make Matrix#[]= public method
https://bugs.ruby-lang.org/issues/14151#change-68286

* Author: greggzst (Grzegorz Jakubiak)
* Status: Feedback
* Priority: Normal
* Assignee: marcandre (Marc-Andre Lafortune)
* Target version: 
----------------------------------------
I don't even understand why this method hasn't been public since the beginning. I've come to a point when I have to create a matrix in a specific way using row and column indices and I can't use #build with a block because then indices go from the beginning of matrix whereas I have to from the center of the matrix. So what I wanted to do is to create a zero matrix and the fill it in a proper way but I can't without using #[]=. I know I can reopen class and that's what I'm doing but this just doesn't make sense. If we can change elements in an array like so using #[]= then why matrices can't use that as well?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>