[#84280] [Ruby trunk Bug#14181] hangs or deadlocks from waitpid, threads, and trapping SIGCHLD — nobu@...
Issue #14181 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/12/15
[#84398] [Ruby trunk Bug#14220] WEBrick changes - failures on MSWIN, MinGW — Greg.mpls@...
Issue #14220 has been reported by MSP-Greg (Greg L).
3 messages
2017/12/22
[#84472] Re: [ruby-dev:50394] [Ruby trunk Bug#14240] warn four special variables: $; $, $/ $\ — Eric Wong <normalperson@...>
Shouldn't English posts be on ruby-core instead of ruby-dev?
3 messages
2017/12/26
[ruby-core:84158] [Ruby trunk Feature#14151] Make Matrix#[]= public method
From:
grzegorz.jakubiak@...
Date:
2017-12-11 12:13:38 UTC
List:
ruby-core #84158
Issue #14151 has been updated by greggzst (Grzegorz Jakubiak). marcandre (Marc-Andre Lafortune) wrote: > The method []= as it is written is also dangerous as it doesn't do any type checking. Try calling `m[1..2, 1..2] = 42` for example... @marcandre I called it using send and it didn't change a thing in my 3x3 Matrix. So what you probably mean we'd have to add this functionality so it works as in arrays when you pass a range. My example (at the end I'm setting one element) : ~~~ ruby m = Matrix[[1,2,3],[1,2,3],[1,2,3]] => Matrix[[1, 2, 3], [1, 2, 3], [1, 2, 3]] m.send(:[]=, 1..2, 1..2, 5) => 5 m => Matrix[[1, 2, 3], [1, 2, 3], [1, 2, 3]] m.send(:set_element, 1..2, 1..2, 5) => 5 m => Matrix[[1, 2, 3], [1, 2, 3], [1, 2, 3]] m.send(:[]=, 1, 1, 5) => 5 m => Matrix[[1, 2, 3], [1, 5, 3], [1, 2, 3]] ~~~ ---------------------------------------- Feature #14151: Make Matrix#[]= public method https://bugs.ruby-lang.org/issues/14151#change-68264 * 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>