From: Robert Klemme Date: 2011-06-21T16:06:05+09:00 Subject: [ruby-core:37256] Re: coerce 2011/6/18 Ond��ej B��lka : > Are there reasons other than historic that coerce returns converted pair instead > returning directly result of operation like > def coerce2(x,op) > �� �� �� ��x.to_foo.call(op,self) > end #coerce's job is to adjust types and not to do calculations. That's a clean separation of concerns because type adjustments might need to be done for any operator so lumping the calculation into #coerce would be totally disastrous from a modularity point of view. Plus, operators can decide themselves what they do with the result of coercion. If you want to know more about the usage you can read up in my blog post here: http://blog.rubybestpractices.com/posts/rklemme/019-Complete_Numeric_Class.html Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/