From: GOTO Kentaro Date: 2002-10-02T11:31:59+09:00 Subject: Re: thoughts on typelessness At Wed, 2 Oct 2002 10:58:08 +0900, Paul Brannan wrote: > But in my mind, this is still an explicit conversion, because String#% > explicitly calls to_s(). I don't think that is explicit conversion because we couldn't know which method would be called. For example, I was surprised by % ruby -e 'class A; def to_int() 10 end end; p("%o" % A.new)' "12" % ruby17 -e 'class A; def to_int() 10 end end; p("%o" % A.new)' "12" % ruby17 -e 'class A; def to_i() 10 end end; p("%o" % A.new)' "12" % ruby17 -e 'class A; def to_i() 10 end; def to_int() 0 end end; p("%o" % A.new)' "0" % ruby -e 'class A; def to_i() 10 end end; p("%o" % A.new)' -e:1:in `%': failed to convert A into Integer (TypeError) from -e:1 Gotoken