You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$stdout set to an object with only #write breaks puts and print #134
Setting $stdout to an object that only implements #write (a logger, a capture object) breaks puts and print:
classW;defwrite(*x)= $stderr.write("[#{x.join}]");end
$stdout =W.newputs'foo'print"bar\n"# CRuby: [foo\n][bar\n]# IronRuby: private method 'puts' called for an instance of W (NoMethodError)
CRuby's Kernel#puts calls $stdout.puts only when it is public. Otherwise it formats the lines itself and calls #write (rb_io_puts through rb_io_writev), and $stdout= only requires #write.
Found by running the scripts PR #119 deleted (Tests/Experiments, Tests/Legacy) on CRuby 4.0.9 and on IronRuby built from master c7f70cf (net10.0, Linux). (Experiments/Globals/Stdout.rb)
Activity