From: Eric Hodel Date: 2007-10-12T00:12:31+09:00 Subject: Re: what does print call internally? On Oct 11, 2007, at 05:03 , 7stud -- wrote: > Eric Hodel wrote: >> On Oct 10, 2007, at 19:58 , 7stud -- wrote: >>> end >>> dog# >> In IO#write, if #to_s returns nil, rb_any_to_s() gets called, which >> returns "#<#{self.class}:0x#{object_id.to_s 16}>", which gets printed >> instead of your broken #to_s. > > How do you get from puts/print to IO.write? Follow the calls in rb_f_print() (Kernel#print). -- Poor workers blame their tools. Good workers build better tools. The best workers get their tools to do the work for them. -- Syndicate Wars