From: dblack@... Date: 2006-07-30T02:12:39+09:00 Subject: Re: to_i vs. to_int Hi -- On Sun, 30 Jul 2006, ts wrote: >>>>>> "d" == dblack writes: > > d> class S > d> def to_int > d> 2 > d> end > d> end > > d> puts 2 + S.new # TypeError: S can't be coerced into Fixnum > > puts 2 | S.new Interesting. What's the rationale for not doing the conversion for + and - and other operator/methods? David -- http://www.rubypowerandlight.com => Ruby/Rails training & consultancy ----> SEE SPECIAL DEAL FOR RUBY/RAILS USERS GROUPS! <----- http://dablog.rubypal.com => D[avid ]A[. ]B[lack's][ Web]log http://www.manning.com/black => book, Ruby for Rails http://www.rubycentral.org => Ruby Central, Inc.