From: Mike Ho Date: 2007-10-04T19:52:48+09:00 Subject: (Newbie) Override * on Array Hi, I've written a simplistic override of the * operator for Arrays so that [2,4,6]*[2,2,2] = [4,8,12] class Array def *(other) each_with_index do |x,i| self[i]= x * other[i] end end end It assumes that the arrays are the same length and no error checking is done. My questions are; is this idiomatic Ruby? What solution would an experienced Rubyist offer? How would it be best to handle exceptions when the arrays are of different dimensions and/or length? Many Thanks Mike -- Posted via http://www.ruby-forum.com/.