From: Christoph Date: 2002-10-02T09:41:17+09:00 Subject: Re: thoughts on typelessness "GOTO Kentaro" wrote .... > > I think "%s" % obj is a kind of implicit conversion. > > % ruby -e 'now = Time.now; def now.to_s() "now" end; puts "%s" % now' > now > % The "print String" conversion seems to follow non obvious rules - for example no recursion seems to possible ... -- class A attr_accessor :x def initialize(x) @x = x end def inspect B.new(x+"b") end end class B < A def inspect C.new(x+"c") end alias to_s inspect end class C < String def inspect ignored end alias to_s inspect end p A.new("a") # abc class T def T.inspect; ignored end def T.to_s; ignored end end class B def inspect T end alias to_s inspect end p A.new("a") # # --- /Christoph