From: Colin Bartlett Date: 2010-05-13T23:08:16+09:00 Subject: Re: In Ruby, can the coerce() method know what operator it is th On Thu, May 13, 2010 at 2:07 PM, Benoit Daloze wrote: > ... > Personally, I used a simple Scalar class like in Matrix, but I just > define the * and / operator. Then if you do > Numeric + Matrix, you get: > NoMethodError: undefined method `+' for # > Which is almost self-explanatory I think. You can drop the "almost"! Out of curiosity - "I used a simple Scalar class like in Matrix": what was that for? (I did do a quick search on "Benoit Daloze" and Ruby, but nothing obviously an answer to that question turned up.)