From: Marc-Andre Lafortune Date: 2009-12-19T10:35:32+09:00 Subject: [ruby-core:27223] [Bug #2495] Matrix: Vector#each2 should check its argument Bug #2495: Matrix: Vector#each2 should check its argument http://redmine.ruby-lang.org/issues/show/2495 Author: Marc-Andre Lafortune Status: Open, Priority: Normal Assigned to: Keiju Ishitsuka, Category: lib, Target version: 1.9.2 ruby -v: ruby 1.9.2dev (2009-12-19 trunk 26121) [x86_64-darwin10.2.0] $ rubydev -r matrix -e 'p Vector[*1..4].each2(nil){|x, y| p "#{x}, #{y}"}' /usr/local/rubydev/lib/ruby/1.9.1/matrix.rb:1149:in `each2': undefined method `size' for nil:NilClass (NoMethodError) $ rubydev -r matrix -e 'p Vector[*1..4].each2(42){|x, y| p "#{x}, #{y}"}' /usr/local/rubydev/lib/ruby/1.9.1/matrix.rb:1149:in `each2': Vector dimension mismatch (ExceptionForMatrix::ErrDimensionMismatch) from -e:1:in `
' $ rubydev -r matrix -e 'p Vector[*1..8].each2(42){|x, y| p "#{x}, #{y}"}' "1, 0" "2, 1" "3, 0" "4, 1" "5, 0" "6, 1" "7, 0" "8, 0" (or vice versa, if on a 32 bit platform) ---------------------------------------- http://redmine.ruby-lang.org