From: Benoit Daloze Date: 2010-05-13T23:25:43+09:00 Subject: Re: In Ruby, can the coerce() method know what operator it is th On 13 May 2010 16:08, Colin Bartlett wrote: > 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"! :D > 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.) :O Google seems to not know me so much then ... But, as many Ruby developers, github is the code's home ;) (while you would hardly find my nickname, except maybe from my email) http://github.com/eregon/math/tree/master/math (You'll see I currently didn't implement Numeric/Matrix, because I don't like my Matrix to inverse 'magically' in this case)