From: WATANABE Hirofumi Date: 2000-04-01T22:26:14+09:00 Subject: [ruby-list:21722] Re: print, puts, printf わたなべです. Yukihiro Matsumoto writes: :こういうものです。だってFOOはObjectのサブクラスですから、呼 :ばれるのは通常のprint、すなわち $<.print の省略系です。この :場合自分に対してwriteするprintを再定義しなくては。 1.5.3 だったら IO を継承してなにもしない initialize を定義す すればできそう. と思ったら printf だけ rb_io_write を使ってない. やっぱこうかな? Sat Apr 1 21:30:53 2000 WATANABE Hirofumi * io.c(rb_io_printf, rb_f_printf): should use rb_io_write. --- io.c.orig Thu Mar 23 22:00:42 2000 +++ io.c Sat Apr 1 15:59:56 2000 @@ -1896,5 +1896,5 @@ VALUE out; { - io_write(out, rb_f_sprintf(argc, argv)); + rb_io_write(out, rb_f_sprintf(argc, argv)); return Qnil; } @@ -1916,5 +1916,5 @@ argc--; } - io_write(out, rb_f_sprintf(argc, argv)); + rb_io_write(out, rb_f_sprintf(argc, argv)); return Qnil;